summaryrefslogtreecommitdiff
path: root/gallery.spec
blob: 95161aacd241e4156855d9545bf46f63599e46eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# TODO:
# - use external libs, not the included ones: pear, smarty, adodb
# - move to separate packages each: theme, module.
%define	_snap	20060728
%define	_rel	0.3
Summary:	Web based photo album viewer and creator
Summary(pl):	Przeglądarka i generator albumów zdjęć w postaci stron WWW
Name:		gallery
Version:	2.1.1a
Release:	1.%{_snap}.%{_rel}
License:	GPL
Group:		Applications/Publishing
#Source0:	http://dl.sourceforge.net/gallery/%{name}-%{version}-full.tar.gz
Source0:	http://galleryupdates.jpmullan.com/G2/%{name}-nightly.tar.gz
# Source0-md5:	6d609d4bbce81c7719799ad953a8b7d1
Source1:	%{name}-apache.conf
Patch0:		%{name}-setup.patch
URL:		http://gallery.sourceforge.net/
BuildRequires:	rpmbuild(macros) >= 1.268
Requires:	php >= 3:4.1.0
Requires:	php-gettext
Requires:	php-pcre
Requires:	webapps
#Suggests:	apache(mod_rewrite)
#Suggests:	jhead
#Suggests:	jpegtran
#Suggests:	php-gd
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define		_webapps	/etc/webapps
%define		_webapp		%{name}
%define		_sysconfdir	%{_webapps}/%{_webapp}
%define		_appdir		%{_datadir}/%{_webapp}

%description
Gallery is a photo album that includes a config wizard and lets users
create and maintain albums via an intuitive Web interface. Photo
management includes automatic thumbnail creation, image resizing,
rotation, ordering and more. Albums can have read, write, and caption
permissions per individual.

%description -l pl
Gallery jest albumem zdjęć, który posiadaj kreatora konfiguracji i
pozwala użytkownikom tworzyć i zarządzać albumami przez intuicyjny
interfejs WWW. Zarządzanie zdjęciami umożliwia automatyczne tworzenie
miniatur, zmianę wielkości obrazów, obrót, zmianę kolejności
wyświetlania, itp. Albumy mogą posiadać indywidualne uprawnienia.

%package setup
Summary:	Gallery setup package
Summary(pl):	Pakiet do wstępnej konfiguracji Gallery
Group:		Applications/WWW
Requires:	%{name} = %{version}-%{release}
Conflicts:	external-gallery-module

%description setup
Install this package to configure initial Gallery installation. You
should uninstall this package when you're done, as it considered
insecure to keep the setup files in place.

%description setup -l pl
Ten pakiet należy zainstalować w celu wstępnej konfiguracji Gallery po
pierwszej instalacji. Potem należy go odinstalować, jako że
pozostawienie plików instalacyjnych mogłoby być niebezpieczne.

%prep
%setup -q -n %{name}2
%patch0 -p1

rm -f LICENSE.txt *.bat

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},/var/lib/gallery/albums}

cp -a *.{php,inc} $RPM_BUILD_ROOT%{_appdir}
cp -a images lib modules themes $RPM_BUILD_ROOT%{_appdir}
cp -a install upgrade $RPM_BUILD_ROOT%{_appdir}
# in /var because of setup/resetadmin file
#cp -a setup $RPM_BUILD_ROOT/var/lib/gallery
#ln -s /var/lib/gallery/setup $RPM_BUILD_ROOT%{_appdir}

install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/config.php
touch $RPM_BUILD_ROOT%{_sysconfdir}/login.txt
ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
ln -s %{_sysconfdir}/login.txt $RPM_BUILD_ROOT%{_appdir}/login.txt

## Cleanup modules that are avaible in separate packages:
for module in exif; do
	rm -rf $RPM_BUILD_ROOT%{_appdir}/modules/$module
done

%clean
rm -rf $RPM_BUILD_ROOT

%triggerin -- apache1
%webapp_register apache %{_webapp}

%triggerun -- apache1
%webapp_unregister apache %{_webapp}

%triggerin -- apache < 2.2.0, apache-base
%webapp_register httpd %{_webapp}

%triggerun -- apache < 2.2.0, apache-base
%webapp_unregister httpd %{_webapp}

%triggerpostun -- %{name} < 1.5.2-0.13
/usr/sbin/webapp register httpd %{_webapp}
%service -q httpd reload

%files
%defattr(644,root,root,755)
%doc README*
%dir %attr(750,root,http) %{_sysconfdir}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
%dir %{_appdir}
%dir /var/lib/gallery
%dir %attr(770,root,http) /var/lib/gallery/albums
%{_appdir}/*.php
%{_appdir}/*.inc
%{_appdir}/images
%{_appdir}/lib
%{_appdir}/modules
%{_appdir}/themes
%{_appdir}/upgrade

%files setup
%defattr(644,root,root,755)
%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/login.txt
%{_appdir}/config.php
%{_appdir}/install
%{_appdir}/login.txt