rpms/glpi/FC-6 glpi-config_path.php, NONE, 1.1 glpi-httpd.conf, NONE, 1.1 glpi-logrotate, NONE, 1.1 glpi.spec, NONE, 1.1 sources, 1.1, 1.2

Remi Collet (remi) fedora-extras-commits at redhat.com
Thu Nov 1 18:45:36 UTC 2007


Author: remi

Update of /cvs/extras/rpms/glpi/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24119

Modified Files:
	sources 
Added Files:
	glpi-config_path.php glpi-httpd.conf glpi-logrotate glpi.spec 
Log Message:
import Release Candidate 2


--- NEW FILE glpi-config_path.php ---
<?php
// for Redhat/Fedora RPM defaults

define("GLPI_CONFIG_DIR",     "/etc/glpi");

define("GLPI_DUMP_DIR",       "/var/lib/glpi/files/_dumps");
define("GLPI_DOC_DIR",        "/var/lib/glpi/files");
define("GLPI_CACHE_DIR",      "/var/lib/glpi/files/_cache/");
define("GLPI_CRON_DIR",       "/var/lib/glpi/files/_cron");
define("GLPI_SESSION_DIR",    "/var/lib/glpi/files/_sessions");
define("GLPI_PLUGIN_DOC_DIR", "/var/lib/glpi/files/_plugins");
define("GLPI_LOCK_DIR",       "/var/lib/glpi/files/_lock/");

define("GLPI_LOG_DIR",        "/var/log/glpi");
?>


--- NEW FILE glpi-httpd.conf ---
Alias /glpi /usr/share/glpi

<Directory /usr/share/glpi>
    Options None
    AllowOverride Limit Options FileInfo

    Order Deny,Allow
    Allow from all
</Directory>

<Directory /usr/share/glpi/config>
    Order Allow,Deny
    Deny from all
</Directory>

<Directory /usr/share/glpi/locales>
    Order Allow,Deny
    Deny from all
</Directory>

<Directory /usr/share/glpi/install/mysql>
    Order Allow,Deny
    Deny from all
</Directory>

<Directory /usr/share/glpi/scripts>
    Order Allow,Deny
    Deny from all
</Directory>

# some people prefer a simple URL like http://glpi.example.com
#<VirtualHost *:80>
#  DocumentRoot /usr/share/glpi
#  ServerName glpi.example.com
#</VirtualHost>



--- NEW FILE glpi-logrotate ---
# Rotate GLPI logs daily, only if not empty
# Save 14 days old logs under compressed mode
/var/log/glpi/*.log {
	daily
	rotate 14
	compress
	notifempty
	missingok
}


--- NEW FILE glpi.spec ---
%if %{?fedora}%{?rhel} >= 5
%define useselinux 1
%else
%define useselinux 0
%endif
%define svndate   20070929
%define tarname   glpi-0.7-RC2

Name:           glpi
Version:        0.70
Release:        0.3.rc2%{?dist}
Summary:        Free IT asset management software
Summary(fr):    Gestion Libre de Parc Informatique

Group:          Applications/Internet
License:        GPLv2
URL:            http://www.glpi-project.org/
Source0:        http://www.glpi-project.org/IMG/gz/%{tarname}.tar.gz

Source1:        glpi-httpd.conf
Source2:        glpi-config_path.php
Source3:        glpi-logrotate

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

Requires:       php-mysql, httpd, php-gd, php-ldap, php-imap
%if 0%{?rhel} == 4
Requires:       php-domxml
%else
Requires:       php-xml
%endif
Requires:       %{_sysconfdir}/logrotate.d
Requires(postun): /sbin/service
Requires(post): /sbin/service
BuildRequires:  dos2unix
%if %{useselinux}
Requires:       policycoreutils
BuildRequires:  selinux-policy-devel, checkpolicy
%endif

%description
GLPI is the Information Resource-Manager with an additional Administration-
Interface. You can use it to build up a database with an inventory for your 
company (computer, software, printers...). It has enhanced functions to make
the daily life for the administrators easier, like a job-tracking-system with
mail-notification and methods to build a database with basic information 
about your network-topology.


%description -l fr
GLPI est une application libre, distribuée sous licence GPL destinée à la
gestion de parc informatique et de helpdesk.

GLPI est composé d’un ensemble de services web écrits en PHP qui permettent
de recenser et de gérer l’intégralité des composantes matérielles ou 
logicielles d’un parc informatique, et ainsi d’optimiser le travail des
techniciens grâce à une maintenance plus cohérente.


%prep
%setup -q -n glpi

mv lib/cache_lite/LICENSE   LICENSE.cache_lite
mv lib/phpmailer/LICENSE    LICENSE.phpmailer
mv lib/tiny_mce/license.txt LICENSE.tiny_mce
dos2unix -o LICENSE.phpmailer LICENSE.tiny_mce
iconv -f ISO-8859-15 -t UTF-8 LISEZMOI.txt >a && mv a LISEZMOI.txt
iconv -f ISO-8859-15 -t UTF-8 README.txt   >a && mv a README.txt

%if %{useselinux}
mkdir selinux
pushd selinux

cat >%{name}.te <<EOF
policy_module(%{name},0.69.1)
require {
  type httpd_sys_content_t;
  type httpd_log_t;
  type httpd_var_lib_t;
}
EOF

cat >%{name}.fc <<EOF
%{_sysconfdir}/%{name}(/.*)?          root:object_r:httpd_sys_content_t:s0
%{_localstatedir}/log/%{name}(/.*)?   system_u:object_r:httpd_sys_content_t:s0
%{_localstatedir}/lib/%{name}(/.*)?   system_u:object_r:httpd_sys_content_t:s0
EOF
%endif


%build
%if %{useselinux}
# SElinux 
pushd selinux
make -f %{_datadir}/selinux/devel/Makefile
popd
%endif


%install
rm -rf %{buildroot} 

# ===== application =====
mkdir -p %{buildroot}/%{_datadir}/%{name}
cp -a *.php *.js %{buildroot}/%{_datadir}/%{name}/

for i in ajax css front help inc install lib locales pics plugins scripts
do   cp -ar $i %{buildroot}/%{_datadir}/%{name}/$i
done

find %{buildroot}/%{_datadir}/%{name} -type f -exec chmod 644 {} \; 
# chmod 755 %{buildroot}/%{_datadir}/%{name}/scripts/*.sh

# ===== apache =====
mkdir -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/
install --mode 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/glpi.conf

# ===== config =====
cp -ar config %{buildroot}/%{_datadir}/%{name}/config
install --mode 644 %{SOURCE2} %{buildroot}/%{_datadir}/%{name}/config/config_path.php

mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
touch %{buildroot}%{_sysconfdir}/%{name}/config_db.php

# ===== files =====
mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}
cp -ar files %{buildroot}/%{_localstatedir}/lib/%{name}/files

# ===== log =====
mkdir -p %{buildroot}%{_localstatedir}/log
mv %{buildroot}/%{_localstatedir}/lib/%{name}/files/_log %{buildroot}%{_localstatedir}/log/%{name}

mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

# cleanup
find %{buildroot} -name remove.txt -exec rm -f {} \; -print

# Directories not in apache space
rm -f %{buildroot}%{_localstatedir}/lib/%{name}/files/.htaccess
# Proctection in /etc/httpd/conf.d/glpi.conf
rm -f %{buildroot}%{_datadir}/%{name}/install/mysql/.htaccess
rm -f %{buildroot}%{_datadir}/%{name}/locales/.htaccess
rm -f %{buildroot}%{_datadir}/%{name}/config/.htaccess
rm -f %{buildroot}%{_datadir}/%{name}/scripts/.htaccess

%if %{useselinux}
# SElinux 
mkdir -p %{buildroot}%{_datadir}/selinux/packages/%{name}
install -m644 selinux/%{name}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}.pp
%endif


%clean
rm -rf %{buildroot} 


%post
%if %{useselinux}
# Install/update Selinux policy
semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp
# files owned by RPM
fixfiles -R %{name} restore
# files created by app
restorecon -R %{_sysconfdir}/%{name}
restorecon -R %{_localstatedir}/lib/%{name}
restorecon -R %{_localstatedir}/log/%{name}
%endif
/sbin/service httpd condrestart > /dev/null 2>&1 || :


%postun
/sbin/service httpd condrestart > /dev/null 2>&1 || :
%if %{useselinux}
if [ "$1" -eq "0" ]; then
    # Remove the SElinux policy.
    semodule -r %{name} || :
fi
%endif


%files
%defattr(-,root,root,-)
%doc *.txt LICENSE.*

%attr(750,apache,root) %dir %{_sysconfdir}/%{name}
%ghost %config(noreplace,missingok) %{_sysconfdir}/%{name}/config_db.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/glpi.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}

%dir %_localstatedir/lib/%{name}
%attr(750,apache,root) %{_localstatedir}/lib/%{name}/files

%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*.php
%{_datadir}/%{name}/*.js
%{_datadir}/%{name}/ajax
%{_datadir}/%{name}/config
%{_datadir}/%{name}/css
%{_datadir}/%{name}/front
%{_datadir}/%{name}/help
%{_datadir}/%{name}/inc
%{_datadir}/%{name}/install
%{_datadir}/%{name}/lib
%{_datadir}/%{name}/pics
%{_datadir}/%{name}/plugins
%{_datadir}/%{name}/scripts
%attr(750,apache,root) %dir %{_localstatedir}/log/%{name}
%dir %{_datadir}/%{name}/locales
%{_datadir}/%{name}/locales/en_GB.php
%lang(bg) %{_datadir}/%{name}/locales/bg_BG.php
%lang(ca) %{_datadir}/%{name}/locales/ca_CA.php
%lang(cs) %{_datadir}/%{name}/locales/cs_CZ.php
%lang(de) %{_datadir}/%{name}/locales/de_DE.php
%lang(dk) %{_datadir}/%{name}/locales/dk_DK.php
%lang(es) %{_datadir}/%{name}/locales/el_EL.php
%lang(es) %{_datadir}/%{name}/locales/es_AR.php
%lang(es) %{_datadir}/%{name}/locales/es_ES.php
%lang(fr) %{_datadir}/%{name}/locales/fr_FR.php
%lang(hu) %{_datadir}/%{name}/locales/hu_HU.php
%lang(it) %{_datadir}/%{name}/locales/it_IT.php
%lang(ja) %{_datadir}/%{name}/locales/ja_JP.php
%lang(nl) %{_datadir}/%{name}/locales/nl_BE.php
%lang(nl) %{_datadir}/%{name}/locales/nl_NL.php
%lang(pl) %{_datadir}/%{name}/locales/pl_PL.php
%lang(pt) %{_datadir}/%{name}/locales/pt_BR.php
%lang(pt) %{_datadir}/%{name}/locales/pt_PT.php
%lang(ro) %{_datadir}/%{name}/locales/ro_RO.php
%lang(ru) %{_datadir}/%{name}/locales/ru_RU.php
%lang(sv) %{_datadir}/%{name}/locales/sv_SE.php
%lang(zh) %{_datadir}/%{name}/locales/zh_CN.php

%if %{useselinux}
%{_datadir}/selinux/packages/%{name}/%{name}.pp
%endif

%changelog
* Thu Nov 01 2007 Remi Collet <Fedora at FamilleCollet.com> - 0.70-0.3.rc2
- correct source

* Thu Nov 01 2007 Remi Collet <Fedora at FamilleCollet.com> - 0.70-0.2.rc2
- Release Candidate 2

* Mon Oct 08 2007 Remi Collet <Fedora at FamilleCollet.com> - 0.70-0.2.rc1
- From review #322781 : fix Source0 and macros
- Requires php-domxml for EL4

* Sun Sep 30 2007 Remi Collet <Fedora at FamilleCollet.com> - 0.70-0.1.rc1
- GLPI Version 0.7-RC1
- initial SPEC for Fedora Review

* Thu May 03 2007 Remi Collet <RPMS at FamilleCollet.com> - 0.70-0.beta.20070503
- initial RPM



Index: sources
===================================================================
RCS file: /cvs/extras/rpms/glpi/FC-6/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	9 Oct 2007 04:38:01 -0000	1.1
+++ sources	1 Nov 2007 18:45:02 -0000	1.2
@@ -0,0 +1 @@
+dd50c6fdcfe1bc2a8a847f76de29f115  glpi-0.7-RC2.tar.gz




More information about the fedora-extras-commits mailing list