codepot/codepot/codepot.spec.in

124 lines
3.2 KiB
RPMSpec
Raw Normal View History

%define _prefix /usr
%define _sysconfdir /etc
%if %{?php_package_name:0}%{!?php_package_name:1}
# if php_package_name is not defined
%define php_package_name php
%endif
Summary: Codepot code repository manager
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: %{php_package_name}.1%{?dist}
License: GPL
2010-04-07 14:38:07 +00:00
Group: Applications/Utilities
#BuildArch: noarch
Source0: %{name}-%{version}.tar.gz
Requires: httpd %{php_package_name} %{php_package_name}-ldap %{php_package_name}-mysql %{php_package_name}-gd subversion subversion-perl mod_dav_svn mod_perl perl perl-LDAP perl-Config-Simple perl-URI perl-DBI perl-Digest-SHA1
# %{php_package_name}-pecl-svn > 1.2.0
BuildRequires: subversion-devel neon-devel %{php_package_name}-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
2010-04-07 14:38:07 +00:00
%description
Codepot code repository manager
%package peclsvn
Summary: PHP Subversion extension
Group: Development/Languages
#BuildArch: %{_target_platform}
2015-04-11 14:28:29 +00:00
# %{PACKAGE_VERSION} is deprecated. %{Version} is supported in some
# recent distros. Never mind. Let's just resort to the autoconf replacement.
Requires: @PACKAGE_NAME@ = @PACKAGE_VERSION@
Conflicts: %{php_package_name}-pecl-svn
%description peclsvn
This package contains svn.so for PHP. You can install this package
if your system doesn't have a proper Subversion extenstion for PHP.
%prep
%setup -q
%build
./configure \
--prefix=/usr \
--libdir=%{_libdir} \
--sysconfdir=/etc \
--with-wwwdir=/var/www/html/codepot \
--with-cfgdir=/etc/codepot \
--with-depotdir=/var/lib/codepot \
--with-logdir=/var/log/codepot \
--with-cachedir=/var/cache/codepot \
--with-phpextdir=%{_libdir}/php/modules \
--with-phpextinidir=%{_sysconfdir}/php.d
make
%install
make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
2010-04-07 14:38:07 +00:00
%defattr(-,root,root)
/var/www/html/codepot
/usr/sbin/codepot-user
2010-04-07 14:38:07 +00:00
%config(noreplace) /etc/codepot/codepot.ini
/etc/codepot/codepot.mysql
2010-04-07 14:38:07 +00:00
/etc/codepot/codepot.a2ldap
/etc/codepot/codepot.httpd
2010-04-07 14:38:07 +00:00
/etc/codepot/start-commit
/etc/codepot/pre-commit
/etc/codepot/post-commit
/etc/codepot/pre-revprop-change
/etc/codepot/post-revprop-change
2015-02-05 13:12:37 +00:00
/etc/codepot/cloc.pl
/etc/codepot/perl/Codepot/AccessHandler.pm
/etc/codepot/perl/Codepot/AuthenHandler.pm
2010-04-07 14:38:07 +00:00
%attr(-,apache,apache) /var/lib/codepot/svnrepo
%attr(-,apache,apache) /var/lib/codepot/files
%attr(-,apache,apache) /var/lib/codepot/attachments
%attr(-,apache,apache) /var/lib/codepot/usericons
2010-04-07 14:38:07 +00:00
%attr(-,apache,apache) /var/log/codepot
%attr(-,apache,apache) /var/cache/codepot
%dir /var/lib/codepot/svnrepo
%dir /var/lib/codepot/files
%dir /var/lib/codepot/attachments
%dir /var/lib/codepot/usericons
2010-04-07 14:38:07 +00:00
%dir /var/log/codepot
%dir /var/cache/codepot
%files peclsvn
%{_libdir}/php/modules/svn.so
%config(noreplace) %{_sysconfdir}/php.d/svn.ini
%pre
exit 0
%post
[ $1 -eq 1 ] && {
# Fresh installation.
# install the httpd configuration file for the first installation
install -D -m 0644 %{_sysconfdir}/codepot/codepot.httpd %{_sysconfdir}/httpd/conf.d/codepot.conf
# change the selinux context on data directories
chcon -Rv --type=httpd_sys_content_t /var/lib/codepot >/dev/null 2>&1
chcon -Rv --type=httpd_sys_content_t /var/cache/codepot >/dev/null 2>&1
}
exit 0
%preun
exit 0
%postun
[ $1 -eq 0 ] && {
# Uninstallation
rm -f %{_sysconfdir}/httpd/conf.d/codepot.conf
}
exit 0