diff --git a/README.md b/README.md index 63ab166..3797854 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # piwik +Piwik is the leading Free/Libre open analytics platform. +Piwik is a full featured PHP MySQL software program that you download and install on your own webserver. + diff --git a/piwik.spec b/piwik.spec new file mode 100644 index 0000000..9caa5ad --- /dev/null +++ b/piwik.spec @@ -0,0 +1,111 @@ +%define serverdir %(apxs -q htdocsdir 2>/dev/null) +# To create a customized installation: +# autospec -u piwik -a5 \ +# -d "installdir=%serverdir/../www.example.com, \ +# sitename=example, \ +# adminmail=webmaster@example.com" + +%if "%{?installdir}" == "" +%define installdir %{serverdir}/piwik +%endif + +%if "%{?sitename}" != "" +%if "%{?servername}" == "" +%define servername %(basename %installdir 2>/dev/null) +%endif +%define serverlogdir %(apxs -q logfiledir 2>/dev/null) +%else +%if "%{?aliasdir}" == "" +%define aliasdir /piwik +%endif +%endif + +Name: %{?sitename:%sitename-website-}piwik +Version: 2.14.3 +Release: 1mamba +Summary: Piwik is the leading Free/Libre open analytics platform +Group: Applications/Web +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://piwik.org +## GITSOURCE https://github.com/piwik/piwik.git 2.14.3 +Source: https://github.com/piwik/piwik.git/%{version}/piwik-%{version}.tar.bz2 +License: GPL +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +Piwik is the leading Free/Libre open analytics platform. +Piwik is a full featured PHP MySQL software program that you download and install on your own webserver. + +%prep +%setup -q + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +install -d %{buildroot}%{installdir} +cp -a * %{buildroot}%{installdir} +#cp .htaccess %{buildroot}%{installdir} + +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 + +AllowOverride All +RewriteEngine On +Order allow,deny +Allow from All + +%if "%{?sitename}" != "" +%if "%(dirname %installdir)" != "%{serverdir}" + + +%{?adminmail:ServerAdmin %adminmail} +DocumentRoot %{installdir} +ServerName %{servername} +ErrorLog %{serverlogdir}/%{servername}-error_log +CustomLog %{serverlogdir}/%{servername}-access_log common + +%endif +%endif +EOF + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +if [ $1 -ge 1 ]; then +[ -e %{_localstatedir}/lock/subsys/httpd ] && service httpd reload || : +fi +: + +%files +%defattr(-,root,root) +%if "%{?sitename}" != "" +%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{servername}.conf +%else +%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{name}.conf +%endif +%dir %{installdir} +%{installdir}/* + +## note: eventually add the remaining documents (if any) +# %doc README.md + +%changelog +* Wed Sep 23 2015 Silvan Calarco 2.14.3-1mamba +- package created using the webbuild interface