codepot/codepot.spec.in

126 lines
3.4 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 perl-Mail-Sendmail
# %{php_package_name}-pecl-svn > 1.2.0
# %{php_package_name}-pgsql perl-DBD-Pg
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 required by Codepot.
It is also safe to install this RPM package without Codepot by ignoring the
dependency.
%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
2022-02-18 14:51:14 +00:00
make install DESTDIR=%{buildroot}
rm -f %{buildroot}/var/lib/codepot/codepot.db
%clean
2022-02-18 14:51:14 +00:00
rm -rf %{buildroot}
%files
2010-04-07 14:38:07 +00:00
%defattr(-,root,root)
/var/www/html/codepot
/usr/sbin/codepot-user
2016-01-20 04:06:51 +00:00
/usr/sbin/codepot-mon-httpd
2010-04-07 14:38:07 +00:00
%config(noreplace) /etc/codepot/codepot.ini
/etc/codepot/codepot.mysql
/etc/codepot/codepot.pgsql
2022-02-18 14:51:14 +00:00
/etc/codepot/codepot.sqlite
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
%dir %attr(-,apache,apache) /var/lib/codepot/svnrepo
%dir %attr(-,apache,apache) /var/lib/codepot/files
%dir %attr(-,apache,apache) /var/lib/codepot/issuefiles
%dir %attr(-,apache,apache) /var/lib/codepot/attachments
%dir %attr(-,apache,apache) /var/lib/codepot/usericons
%dir %attr(-,apache,apache) /var/log/codepot
%dir %attr(-,apache,apache) /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