Skip to content

Commit

Permalink
Merge pull request #24 from asiminiceanu/master
Browse files Browse the repository at this point in the history
Add spec file for RPM build
  • Loading branch information
giggsey committed Apr 16, 2014
2 parents 5c03131 + 676501a commit 081d411
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
},
"archive": {
"exclude": ["Tests/", "build/", "/.travis.yml", "/build.xml", "phpunit.xml.dist"]
"exclude": ["Tests/", "build/", "/.travis.yml", "/build.xml", "phpunit.xml.dist", "libphonenumber-for-php.spec"]
},
"require": {
"ext-intl": "*"
Expand Down
45 changes: 45 additions & 0 deletions libphonenumber-for-php.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Define version and release number
%define version @PACKAGE_VERSION@
%define release 1
%define php_version 53

Name: libphonenumber-for-php
Version: %{version}
Release: %{release}.php%{php_version}%{?dist}
Summary: libphonenumber for PHP
# See https://github.com/giggsey/libphonenumber-for-php/blob/master/LICENSE
License: Apache 2.0
Group: Development/Libraries
URL: https://github.com/giggsey/libphonenumber-for-php
# Get the source files from https://github.com/giggsey/libphonenumber-for-php/tags
Source: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
A PHP library for parsing, formatting, storing and validating international phone numbers.
This library is based on Google's libphonenumber and forked from a version by Davide Mendolia.

%prep
%setup -q
%build

# Clean the buildroot so that it does not contain any stuff from previous builds
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

# Install the extension
install -d %{buildroot}

# Prepare files
mkdir -p %{buildroot}/usr/share/php
cp -a src/libphonenumber/ %{buildroot}/usr/share/php

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
/usr/share/php/libphonenumber

%changelog
* Wed Apr 16 2014 Adrian Siminiceanu <adrian.siminiceanu@gmail.com>
- Initial spec file

0 comments on commit 081d411

Please sign in to comment.