Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > media > contrib-release-src > by-pkgid > 69e52859cc018ca00efde57eb2117f43 > files > 3

apache-gallery-1.0-0.RC2.6mdv2007.0.src.rpm

%define name	apache-gallery
%define module	Apache-Gallery
%define version	1.0
%define pre	RC2
%define release	%mkrel 0.%{pre}.6

Name:		    %{name}
Version:	    %{version}
Release:	    %{release}
Summary:	    A mod_perl handler to create an image gallery
License:	    GPL or Artistic
Group:		    Networking/WWW
URL:		    http://apachegallery.dk/
Source0:	    http://apachegallery.dk/download/%{module}-%{version}%{pre}.tar.bz2
Patch0:		    %{name}-0.9.5.urlbase.patch
Requires:	    apache-mod_perl
# webapp macros and scriptlets
Requires(post):		rpm-helper >= 0.16
Requires(postun):	rpm-helper >= 0.16
Obsoletes:	    perl-Apache-gallery
Provides:	    perl-Apache-gallery
BuildRequires:	rpm-helper >= 0.16
BuildRequires:	rpm-mandriva-setup >= 1.23
BuildRequires:	apache-mod_perl
%if %{mdkversion} < 1010
BuildRequires:	perl-devel
%endif
BuildRequires:	perl(URI::Escape)
BuildRequires:	perl(Image::Imlib2)
BuildRequires:	perl(Image::Info)
BuildRequires:	perl(Image::Size)
BuildRequires:	perl(Text::Template)
BuildRequires:	perl(Test::MockObject)
BuildArch:	    noarch
BuildRoot:	    %{_tmppath}/%{name}-%{version}

%description
Apache::Gallery creates an thumbnail index of each directory and
allows viewing pictures in different resolutions. Pictures are
resized on the fly and cached.

%prep
%setup -q -n %{module}-%{version}%{pre}
%patch0 -p 1

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%make

%install
rm -rf %{buildroot}
%makeinstall_std
install -d -m 755 %{buildroot}%{_datadir}/apache-gallery/default
install -d -m 755 %{buildroot}/var/www/apache-gallery/static

for template in default new; do
    install -d -m 755 %{buildroot}%{_datadir}/apache-gallery/$template
    install -m 644 templates/$template/*.tpl %{buildroot}%{_datadir}/apache-gallery/$template
    install -m 644 templates/$template/gallery.css %{buildroot}/var/www/apache-gallery/static/$template.css
done

install -m 644 htdocs/* %{buildroot}/var/www/apache-gallery/static

install -d -m 755 %{buildroot}/var/www/apache-gallery/photos

install -d -m 755 %{buildroot}/var/cache/apache-gallery

# apache configuration
install -d -m 755 %{buildroot}%{_webappconfdir}
cat > %{buildroot}%{_webappconfdir}/%{name}.conf <<EOF
# %{name} Apache configuration
Alias /apache-gallery/static /var/www/apache-gallery/static
Alias /apache-gallery /var/www/apache-gallery/photos

<IfModule mod_perl.c>
    PerlSetVar GalleryTemplateDir '/usr/share/apache-gallery/default'
    PerlSetVar GalleryCacheDir    '/var/cache/apache-gallery'
    PerlSetVar GalleryURLBase     '/apache-gallery/static'
    PerlOptions +GlobalRequest

    <Directory /var/www/apache-gallery>
        Allow from all
    </Directory>

    <Directory /var/www/apache-gallery/photos>
        SetHandler        modperl
        PerlResponseHandler       Apache::Gallery
    </Directory>

    <Directory /var/cache/apache-gallery>
        Allow from all
    </Directory>
</ifModule>
EOF

%check
make test

%clean 
rm -rf %{buildroot}

%post
%_post_webapp

%postun
%_postun_webapp

%files
%defattr(-,root,root)
%doc README Changes INSTALL LICENSE TODO UPGRADE
%config(noreplace) %{_webappconfdir}/%{name}.conf
%{perl_vendorlib}/Apache
%{_datadir}/%{name}
%attr(-,apache,apache) /var/cache/%{name}
/var/www/%{name}
%{_mandir}/*/*

%changelog
* Thu Aug 31 2006 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.6mdv2007.0
- buildrequires (URI::Escape)

* Fri Jun 30 2006 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.5mdv2007.0
- relax buildrequires versionning
- buildrequires perl(Image::Size)

* Mon Jun 26 2006 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.4mdv2007.0
- rebuild with corrected webapp macros

* Tue Jun 20 2006 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.3mdv2007.0
- rename to %{name}, as it is not a perl library
- mv data files under %{_datadir}/%{name}, web files under /var/www/%{name} and temp files under /var/cache/%{name}
- fix stylesheet install
- drop previous patches
- new configurable base url patch
- default apache configuration

* Tue Jun 28 2005 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.2mdk 
- requires apache-mod_perl
- drop useless patches
- include empty templates, otherwise the application crashes

* Thu Jun 02 2005 Guillaume Rousse <guillomovitch@mandriva.org> 1.0-0.RC2.1mdk 
- new version
- re-enable make test in %%check

* Fri Feb 18 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.9.1-4mdk
- spec file cleanups, remove the ADVX-build stuff
- disable make test for now

* Wed Jan 26 2005 Guillaume Rousse <guillomovitch@mandrake.org> 0.9.1-3mdk 
- fix non-jpg images issue
- fix icons path
- use /var/cache/gallery as cache location
- fix lowercase summary
- remove empty files
- change URL

* Fri Sep 17 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.9.1-2mdk 
- fixed mod_perl2 issue

* Sun Sep 12 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.9.1-1mdk
- new version  
- buildrequires

* Wed Jul 21 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.8-2mdk 
- rpmbuildupdate aware

* Wed Apr 07 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.8-1mdk
- new version
- correct source URL
- corrected buildrequires

* Wed Feb 25 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.7-4mdk
- fixed dir ownership (distlint)

* Mon Jan 12 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.7-3mdk
- buildrequires (slbd)

* Mon Dec 08 2003 Guillaume Rousse <guillomovitch@mandrake.org> 0.7-2mdk
- included missing templates and icons

* Mon Dec 08 2003 Guillaume Rousse <guillomovitch@mandrake.org> 0.7-1mdk
- first mdk release