trunk/SFEphp54-pecl-oauth.spec
branchspec-files-extra
changeset 10664 b426544f1ec2
equal deleted inserted replaced
10663:fa1ca407cdfb 10664:b426544f1ec2
       
     1 #
       
     2 # spec file for package SFEphp-pecl-oauth
       
     3 #
       
     4 # includes module(s): php pecl oauth
       
     5 #
       
     6 # modeled after https://github.com/remicollet/remirepo/raw/master/php/pecl/php-pecl-oauth/php-pecl-oauth.spec
       
     7 
       
     8 
       
     9 # SFE-webstack
       
    10 
       
    11 %include Solaris.inc
       
    12 %include packagenamemacros.inc
       
    13 
       
    14 %define php_version   5.4
       
    15 ##not defined %define php_major_version   5
       
    16 %define php_major_minor_version   5.4
       
    17 ##not defined %define php_major_minor_micro_version 5.4.11
       
    18 
       
    19 %define pecl_name oauth
       
    20 %define php_inidir /etc/php/%{php_major_minor_version}/conf.d
       
    21 %define pecl_xmldir /var/php/%{php_major_minor_version}/pear/.pkgxml
       
    22 
       
    23 Name:                    SFEphp54-pecl-oauth
       
    24 IPS_package_name:	 web/php-54/pecl/oauth
       
    25 Summary:                 php pecl oauth - OAuth 1.0 consumer and provider extension
       
    26 Version:                 1.2.3
       
    27 Source:                  http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
       
    28 URL:                     http://pecl.php.net/package/%{pecl_name}
       
    29 License:                 BSD
       
    30 SUNW_Copyright:          %{pecl_name}license.copyright
       
    31 SUNW_BaseDir:            /
       
    32 #Patch1:                  php-pecl-oauth-01-oauth-tests.diff
       
    33 BuildRoot:               %{_tmppath}/%{name}-%{version}-build
       
    34 %include default-depend.inc
       
    35 
       
    36 BuildRequires: SFEphp54
       
    37 Requires:      SFEphp54
       
    38 
       
    39 %description
       
    40 This PHP extension allows you to use OAuth 1.0
       
    41 OAuth is an authorization protocol built on top of HTTP which allows
       
    42 applications to securely access data without having to store user-
       
    43 names and passwords.
       
    44 
       
    45 This package provides an API for fetching and serving OAuth protected
       
    46 resources.
       
    47 
       
    48 %prep
       
    49 %setup -q -c -n %{pecl_name}-%{version}
       
    50 
       
    51 #cd %{pecl_name}-%{version}
       
    52 #%patch1 -p0 -b .tests
       
    53 #cd ..
       
    54 
       
    55 gsed -ibak -e 's,CFLAGS="$CFLAGS -Wall -g",,' %{pecl_name}-%{version}/config.m4
       
    56 
       
    57 
       
    58 cat > %{pecl_name}.ini << 'EOF'
       
    59 ; Enable %{pecl_name} extension module
       
    60 extension=%{pecl_name}.so
       
    61 EOF
       
    62 
       
    63 %build
       
    64 CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
       
    65 if test "x$CPUS" = "x" -o $CPUS = 0; then
       
    66     CPUS=1
       
    67 fi
       
    68 
       
    69 export PKG_CONFIG_PATH=/usr/gnu/lib/pkgconfig:$PKG_CONFIG_PATH
       
    70 export CFLAGS="%optflags"
       
    71 export LDFLAGS="%{_ldflags}"
       
    72 export CFLAGS="$CFLAGS -I %{gnu_inc}"
       
    73 export LDFLAGS="$LDFLAGS %{gnu_lib_path}"
       
    74 
       
    75 #from OS Makefile (php5.2)
       
    76 export CFLAGS="$CFLAGS -xjobs=16 -fsimple=2 -xnorunpath -xO4 -xalias_level=basic -xipo=0"
       
    77 export CFLAGS="$CFLAGS -xlibmopt -xprefetch_level=1 -xprefetch=auto -xstrconst -zlazyload"
       
    78 
       
    79 PHP_REL=%{php_major_minor_version}
       
    80 TOP_DIR=%{_prefix}/php/%{php_major_minor_version}
       
    81 MODULES_DIR=%{_prefix}/php/%{php_major_minor_version}/modules
       
    82 CONF_DIR=/etc/php/${PHP_REL}
       
    83 MODULES_CONF_DIR=${CONF_DIR}/conf.d
       
    84 PEAR_DIR=/var/php/${PHP_REL}/pear
       
    85 SAMPLES_DIR=%{_prefix}/php/%{php_major_minor_version}/samples
       
    86 
       
    87 #NOTE: the following variables are ENV variables to configure
       
    88 PHP_PEAR_CACHE_DIR=/var/tmp/pear/cache \
       
    89 PHP_PEAR_DOWNLOAD_DIR=/var/tmp/pear/cache \
       
    90 PHP_PEAR_EXTENSION_DIR=/var/php/${PHP_REL}/modules \
       
    91 PHP_PEAR_INSTALL_DIR=/var/php/${PHP_REL}/pear \
       
    92 PHP_PEAR_SIG_BIN=/usr/gnu/bin/gpg \
       
    93 
       
    94 cd %{pecl_name}-%{version}
       
    95 $TOP_DIR/bin/phpize
       
    96 ./configure  \
       
    97             --with-php-config=%{_prefix}/php/%{php_major_minor_version}/bin/php-config
       
    98 
       
    99 gmake -j$CPUS
       
   100 
       
   101 
       
   102 %install
       
   103 rm -rf $RPM_BUILD_ROOT
       
   104 
       
   105 cd %{pecl_name}-%{version}
       
   106 make install INSTALL_ROOT=%{buildroot}
       
   107 cd ..
       
   108 # Install XML package description
       
   109 install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
       
   110 
       
   111 # install config file
       
   112 install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
       
   113 
       
   114 #rm ${RPM_BUILD_ROOT}%{_sysconfdir}/php/%{php_major_minor_version}/pear.conf
       
   115 
       
   116 mkdir -p ${RPM_BUILD_ROOT}%{_docdir}/php%{php_version}-%{pecl_name}-%{version}
       
   117 cp -pr %{pecl_name}-%{version}/examples ${RPM_BUILD_ROOT}%{_docdir}/php%{php_version}-%{pecl_name}-%{version}
       
   118 
       
   119 %clean
       
   120 rm -rf $RPM_BUILD_ROOT
       
   121 
       
   122 %files
       
   123 %defattr (-, root, bin)
       
   124 #%doc %{pecl_name}-%{version}/{README,ChangeLog}
       
   125 %dir %attr (0755, root, sys) %{_prefix}
       
   126 %{_prefix}/php/%{php_major_minor_version}/*
       
   127 %dir %attr (0755, root, sys) %{_datadir}
       
   128 %dir %attr (0755, root, other) %{_docdir}
       
   129 %{_docdir}/php%{php_version}-%{pecl_name}-%{version}/*
       
   130 
       
   131 %defattr (-, root, bin)
       
   132 %dir %attr (0755, root, sys) %{_localstatedir}
       
   133 %{_localstatedir}/php/%{php_major_minor_version}/pear/.pkgxml/*
       
   134 
       
   135 %defattr (-, root, bin)
       
   136 %dir %attr(0755, root, sys) %{_sysconfdir}
       
   137 %config(noreplace) %{_sysconfdir}/php/%{php_major_minor_version}/conf.d/%{pecl_name}.ini
       
   138 
       
   139 %changelog
       
   140 * Tue Feb 19 2013 - Thomas Wagner
       
   141 - initial spec