Skip to content

Instantly share code, notes, and snippets.

@kurtpayne
Created April 4, 2012 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurtpayne/2305414 to your computer and use it in GitHub Desktop.
Save kurtpayne/2305414 to your computer and use it in GitHub Desktop.
Zend Framework RPM spec
%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 <kpayne@godaddy.com>
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 <kpayne@godaddy.com>
- Initial RPM release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment