Created
April 4, 2012 20:38
-
-
Save kurtpayne/2305414 to your computer and use it in GitHub Desktop.
Zend Framework RPM spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%define source0 ZendFramework-1.11.5.tar.gz | |
%define name ZendFramework | |
%define version 1.11.5 | |
Name: ZendFramework | |
Summary: ZendFramework %{version} for PHP | |
Version: %{version} | |
Release: 1 | |
Group: GoDaddy | |
License: BSD | |
URL: http://framework.zend.com/ | |
Packager: Kurt Payne <[email protected]> | |
Source: %{source} | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot | |
Prefix: %{_prefix} | |
Provides: %{name} | |
BuildRequires: php | |
%description | |
Zend Framework (ZF) is an open source, object-oriented web | |
application framework implemented in PHP 5 and licensed | |
under the New BSD License. | |
Zend Framework features include: | |
* All components are fully object-oriented PHP 5 and are | |
E_STRICT compliant | |
* Use-at-will architecture with loosely coupled components | |
and minimal interdependencies | |
* Extensible MVC implementation supporting layouts and | |
PHP-based templates by default | |
* Support for multiple database systems and vendors, including | |
MariaDB, MySQL, Oracle, IBM DB2, Microsoft SQL Server, | |
PostgreSQL, SQLite, and Informix Dynamic Server | |
* Email composition and delivery, retrieval via mbox, Maildir, | |
POP3 and IMAP4 | |
* Flexible caching sub-system with support for many types of | |
backends, such as memory or a file system. | |
%install | |
%{__mkdir_p} $RPM_BUILD_ROOT/var/www/%{name}-%{version} | |
cd $RPM_BUILD_ROOT/var/www/ | |
tar -xzf $RPM_SOURCE_DIR/%{source0} | |
%post | |
# Remind the user to add the ZF path to the php include_path | |
INI_FILES=`php --ini | tail -n +2 | egrep -o "\S+.ini"`; | |
INCLUDE_PATH=`egrep -o '^include_path\s*=\s*(.*)' $INI_FILES`; | |
x=`echo $INCLUDE_PATH | grep '/var/www/%{name}-%{version}/library' | wc -l` | |
if [ "$x" = "0" ]; then | |
echo "Please add /var/www/%{name}-%{version}/library to your include_path in one of your php configuration files"; | |
echo "Your configuration files are:"; | |
for file in $INI_FILES; do | |
echo $file | |
done | |
echo "Your include_path is $INCLUDE_PATH"; | |
fi | |
# Create a link to the "zf" binary | |
if [ -e /usr/local/bin/zf ]; then | |
rm -f /usr/local/bin/zf | |
fi | |
ln -s /var/www/%{name}-%{version}/bin/zf.sh /usr/local/bin/zf | |
chmod 755 /usr/local/bin/zf | |
%postun | |
# Remind the user to remove the ZF path to the php include_path | |
INI_FILES=`php --ini | tail -n +2 | egrep -o "\S+.ini"`; | |
INCLUDE_PATH=`egrep -o '^include_path\s*=\s*(.*)' $INI_FILES`; | |
x=`echo $INCLUDE_PATH | grep '/var/www/%{name}-%{version}/library' | wc -l` | |
if [ "$x" = "1" ]; then | |
echo "Please remove /var/www/%{name}-%{version}/library from your include_path in your php configuration files"; | |
echo "Your configuration files are:"; | |
for file in $INI_FILES; do | |
echo $file | |
done | |
echo "Your include_path is $INCLUDE_PATH"; | |
fi | |
# Remove the link to the "zf" binary | |
if [ -e /usr/local/bin/zf ]; then | |
rm -f /usr/local/bin/zf | |
fi | |
%clean | |
%{__rm} -rf %{buildroot} | |
%files | |
%defattr(-, apache, apache) | |
/var/www/%{name}-%{version} | |
%changelog | |
* Tue Apr 12 2011 Kurt Payne <[email protected]> | |
- Initial RPM release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment