I put in a feature request and then went and did the work on my own
anyway. Below is a first pass at building a RPM package targeted at
Fedora 20 and CentOS 7. In both cases, default and minimal installs of
the OS. While PHPIPAM is easy enough to install, a package is even
easier!
Anyone cook up a deb?
Things I noticed about installing PHPIPAM on Fedora/Centos:
1. By default Mysql server (MariaDB) does not have any credentials
set. PHPIPAM assumes and requires credentials are set.
2. By default php environment does not have date.timezone set to a
global value. The RPM detects and warns about that.
3. Appears to be a problem with how LOCALE is managed in the app when
running on CentOS? I reported it as a bug and am working on it still.
This is my phpipam RPM spec file:
---clip here--------
Name: phpipam
Version: 1.1.010
Release: 1%{?dist}
Summary: phpipam is an open-source web IP address management
Group: Applications/Internet
License: GPLv2+
URL: http://www.phpipam.net
Packager: bu...@f2...
Source0: phpipam-1.1.010.tar
BuildRequires: httpd php-common
Requires: httpd mariadb mariadb-server mariadb-libs php-gmp
Requires: php php-common php-pear
%if 0%{?_with_systemd}
Requires(preun): systemd
Requires(postun): systemd
Requires(post): systemd
%else
Requires(postun): /sbin/service
%endif
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
%description
phpipam is an open-source web IP address
%prep
%setup -n phpipam
%build
# nothing to build
%install
%{__install} -d -m 0755 %{buildroot}/var/www/html/%{name}/
%{__install} -d -m 0755 %{buildroot}/etc/httpd/conf.d/
%{__cp} -a %{_builddir}/%{name}/* %{buildroot}/var/www/html/%{name}/
%{__cp} -a %{_builddir}/%{name}/.htaccess %{buildroot}/var/www/html/%{name}/
%{__cp} -a %{_sourcedir}/phpipam.conf %{buildroot}/etc/httpd/conf.d/
# Update config file: sed s/BASE\'\,\ \"\\//BASE\'\,\ \"\\/phpipam\\/\"/
sed s/BASE\'\,\ \"\\//BASE\'\,\ \"\\/phpipam\\//
%{_builddir}/%{name}/config.pp
%post
%if 0%{?_with_systemd}
%systemd_post httpd.service
%else
if [ $1 == 1 ]; then
/sbin/service httpd condrestart > /dev/null 2>&1 || :
fi
%endif
# add a test for php global date.timezone !
# grep -c "^date.timezone.*=.*[[:alnum:]]" /etc/php.ini
TIMEZONE_CONFIGURED=`grep -c "^date.timezone.*=.*[[:alnum:]]" /etc/php.ini`
if [ $TIMEZONE_CONFIGURED == 0 ]; then
echo "ERROR: appears PHP default timezone is not set!" >
/dev/stderr;
echo " set PHP default date.timezone in /etc/php.ini" >
/dev/std;
echo " See phpipam bug report #56 for details" > /dev/stderr;
# else
# PHP_TIMEZONE=`grep "^date.timezone.*=.*[[:alnum:]]" /etc/php.ini`
# echo "PHP default timezone is set: $PHP_TIMEZONE" > /dev/stdout;
fi
%postun
%if 0%{?_with_systemd}
%systemd_postun_with_restart httpd.service
%else
/sbin/service httpd condrestart > /dev/null 2>&1 || :
%endif
%files
/var/www/html/.
/etc/httpd/conf.d/phpipam.conf
%doc
%changelog
|