cgit/cgit.spec

170 lines
4.6 KiB
RPMSpec

%define cgidir %(apxs -q cgidir 2>/dev/null)
%define serverdir %(apxs -q htdocsdir 2>/dev/null)
%define gitver 2.34.1
# To create a customized installation of cgit:
# autospec -u cgit -a5 \
# -d "installdir=%serverdir/../www.example.com, \
# sitename=example, \
# adminmail=webmaster@example.com"
%if "%{?installdir}" == ""
%define installdir %{serverdir}/cgit
%endif
%if "%{?sitename}" != ""
%if "%{?servername}" == ""
%define servername %(basename %installdir 2>/dev/null)
%endif
%define cgidir %{installdir}
%define serverlogdir %(apxs -q logfiledir 2>/dev/null)
%else
%if "%{?aliasdir}" == ""
%define aliasdir /cgit
%endif
%endif
Name: %{?sitename:%sitename-website-}cgit
Version: 1.2.3
Release: 1mamba
Summary: A web frontend for git repositories
Group: Applications/Web
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://git.zx2c4.com/cgit/
Source: http://git.zx2c4.com/cgit/snapshot/cgit-%{version}.tar.xz
Source1: cgitrc
# cgit statically depends on a specific git version
Source2: http://kernel.org/pub/software/scm/git/git-%{gitver}.tar.xz
Patch0: cgit-1.2.3-git-2.34.1.patch
Patch1: cgit-0.8.3.1-cflags.patch
License: GPL
## AUTOBUILDREQ-BEGIN
#user(apache): unidentified build requirement
BuildRequires: glibc-devel
BuildRequires: libluajit-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
Requires: cgit-common = %{version}-%{release}
%description
An attempt to create a fast web interface for the git scm, using a builtin cache to decrease server io-pressure.
%package common
Summary: Common files provided by cgit
Group: Applications/Web
%description common
Common files provided by cgit.
%debug_package
%prep
%setup -q -a2
rmdir git
mv git-%{gitver} git
%patch 0 -p1 -b .git-2.34.1
%build
%make V=1 \
prefix=%{_prefix} \
CGIT_SCRIPT_PATH=%{cgidir}
# CFLAGS="%{optflags} -I%{_includedir}/git-core" \
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall V=1 \
prefix=%{_prefix} \
DESTDIR=%{buildroot} \
CACHE_ROOT=%{_localstatedir}/cache/cgit \
CGIT_SCRIPT_PATH=%{cgidir} \
CGIT_DATA_PATH=%{installdir}
install -D -m0644 %{S:1} %{buildroot}%{_sysconfdir}/cgitrc
install -d %{buildroot}%{_localstatedir}/cache/cgit
install -d %{buildroot}%{_sysconfdir}/httpd/httpd.d
%if "%{?sitename}" != ""
cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{servername}.conf << EOF
%else
cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{name}.conf << EOF
%endif
%if "%{?sitename}" == ""
%if "%(dirname %installdir)" != "%{serverdir}"
Alias %{aliasdir} %{installdir}
%endif
%endif
<Directory %{installdir}>
AllowOverride All
Order allow,deny
Allow from All
Options ExecCGI
<Files cgit.cgi>
SetHandler cgi-script
</Files>
</Directory>
%if "%{?sitename}" != ""
%if "%(dirname %installdir)" != "%{serverdir}"
<VirtualHost *:80>
%{?adminmail:ServerAdmin %adminmail}
DocumentRoot %{installdir}
ServerName %{servername}
ErrorLog %{serverlogdir}/%{servername}-error_log
CustomLog %{serverlogdir}/%{servername}-access_log common
DirectoryIndex cgit.cgi
</VirtualHost>
%endif
%endif
EOF
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%if "%{?sitename}" != ""
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{servername}.conf
%else
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{name}.conf
%endif
%config(noreplace) %{_sysconfdir}/cgitrc
%{cgidir}/cgit.cgi
%{installdir}/cgit.css
%{installdir}/cgit.png
%{installdir}/favicon.ico
%{installdir}/robots.txt
%dir %attr(-,apache,root) %{_localstatedir}/cache/cgit
%files common
%defattr(-,root,root)
%dir %{_prefix}/lib/cgit
%dir %{_prefix}/lib/cgit/filters
%{_prefix}/lib/cgit/filters/*
%doc COPYING
#README cgitrc.5.txt
%changelog
* Mon May 27 2024 Automatic Build System <autodist@openmamba.org> 1.2.3-1mamba
- automatic version update by autodist
* Thu Oct 09 2014 Automatic Build System <autodist@mambasoft.it> 0.10.2-1mamba
- automatic version update by autodist
* Fri Feb 28 2014 Automatic Build System <autodist@mambasoft.it> 0.10.1-1mamba
- automatic version update by autodist
* Sat Jan 18 2014 Automatic Build System <autodist@mambasoft.it> 0.10-1mamba
- automatic version update by autodist
* Mon Aug 12 2013 Automatic Build System <autodist@mambasoft.it> 0.9.2-1mamba
- update to 0.9.2
* Fri Mar 19 2010 Stefano Cotta Ramusino <stefano.cotta@openmamba.org> 0.8.3.1-1mamba
- package created by autospec