]> git.pld-linux.org Git - packages/phpMyAdmin.git/blob - phpMyAdmin.spec
- simplified prep
[packages/phpMyAdmin.git] / phpMyAdmin.spec
1 Summary:        phpMyAdmin - web-based MySQL administration
2 Summary(pl):    phpMyAdmin - administracja bazami MySQL przez WWW
3 Name:           phpMyAdmin
4 %define         _pl     rc2
5 %define         _rel    3
6 # NOTE: bump _rel with every new patchlevel
7 Version:        2.6.0
8 #Release:       0.%{_pl}.%{_rel}
9 Release:        1
10 License:        GPL v2
11 Group:          Applications/Databases/Interfaces
12 #Source0:       http://dl.sourceforge.net/phpmyadmin/%{name}-%{version}-%{_pl}.tar.bz2
13 Source0:        http://dl.sourceforge.net/phpmyadmin/%{name}-%{version}.tar.bz2
14 # Source0-md5:  7d8dc68a88aca0c5f36c5d8996bb563f
15 Source1:        %{name}.conf
16 Patch0:         %{name}-config.patch
17 URL:            http://www.phpmyadmin.net/
18 #Requires:      mysql
19 Requires(postun):       perl-base
20 Requires:       php-mysql
21 Requires:       php-pcre
22 Requires:       php
23 Requires:       webserver
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _myadmindir     %{_datadir}/%{name}
28 %define         _sysconfdir     /etc/%{name}
29
30 %description
31 phpMyAdmin can administer a whole MySQL-server (needs a super-user)
32 but also a single database. To accomplish the latter you'll need a
33 properly set up MySQL-user who can read/write only the desired
34 database. It's up to you to look up the appropiate part in the MySQL
35 manual. Currently phpMyAdmin can:
36   - create and drop databases
37   - create, copy, drop and alter tables
38   - delete, edit and add fields
39   - execute any SQL-statement, even batch-queries
40   - manage keys on fields
41   - load text files into tables
42   - create (*) and read dumps of tables
43   - export (*) and import data to CSV values
44   - administer multiple servers and single databases
45   - communicate in more than 20 different languages
46
47 %description -l pl
48 phpMyAdmin potrafi zarz±dzaæ ca³ymi bazami MySQL (potrzebne
49 uprawnienia super-user'a) jak i pojedynczymi bazami danych. Bêdziesz
50 potrzebowa³ u¿ytkownika, który ma prawa zapisu/odczytu tylko tych baz,
51 którymi chcesz administrowaæ (zajrzyj do odpowiedniej czê¶ci manual'a
52 MySQL). Aktualnie phpMyAdmin potrafi:
53   - tworzyæ i usuwaæ bazy
54   - create, copy, drop oraz alter na tabelach
55   - dodawaæ, usuwaæ i edytowaæ pola
56   - wykonywaæ dowolne zapytania SQL
57   - zarz±dzaæ kluczami na rekordach
58   - wczytywaæ tekst z plików do tabel
59   - obs³ugiwaæ ponad 20 jêzyków
60   - zarz±dzaæ wieloma serwerami i pojedyñczymi bazami danych
61   - eksportowaæ i importowaæ dane do warto¶ci CSV
62   - tworzyæ i czytaæ zrzuty tabel
63
64 %prep
65 #%setup -q -n %{name}-%{version}-%{_pl}
66 %setup -q
67 %patch -p1
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT%{_myadmindir}/{css,lang,libraries/{auth,export,dbg,dbi,transformations}} \
72         $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd}
73
74 install *.php *.html *.css $RPM_BUILD_ROOT%{_myadmindir}
75 #install images/*.{gif,png} $RPM_BUILD_ROOT%{_myadmindir}/images
76 install lang/*.php $RPM_BUILD_ROOT%{_myadmindir}/lang
77 cp -rf themes  $RPM_BUILD_ROOT%{_myadmindir}/
78 install css/* $RPM_BUILD_ROOT%{_myadmindir}/css
79 install libraries/*.{js,php} $RPM_BUILD_ROOT%{_myadmindir}/libraries
80 install libraries/auth/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/auth
81 install libraries/export/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/export
82 install libraries/dbg/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/dbg
83 install libraries/dbi/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/dbi
84 install libraries/transformations/*.php $RPM_BUILD_ROOT%{_myadmindir}/libraries/transformations
85
86 cp -rf scripts $RPM_BUILD_ROOT%{_myadmindir}
87
88 install config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}
89 ln -sf %{_sysconfdir}/config.inc.php $RPM_BUILD_ROOT%{_myadmindir}/config.inc.php
90
91 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %post
97 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
98         echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
99         if [ -f /var/lock/subsys/httpd ]; then
100                 /usr/sbin/apachectl restart 1>&2
101         fi
102 elif [ -d /etc/httpd/httpd.conf ]; then
103         ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
104         if [ -f /var/lock/subsys/httpd ]; then
105                 /usr/sbin/apachectl restart 1>&2
106         fi
107 fi
108
109 %preun
110 if [ "$1" = "0" ]; then
111         umask 027
112         if [ -d /etc/httpd/httpd.conf ]; then
113             rm -f /etc/httpd/httpd.conf/99_%{name}.conf
114         else
115                 grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
116                         /etc/httpd/httpd.conf.tmp
117                 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
118         fi
119         if [ -f /var/lock/subsys/httpd ]; then
120             /usr/sbin/apachectl restart 1>&2
121         fi
122 fi
123
124 %triggerpostun -- phpMyAdmin <= 2.5.3-2
125 if [ -f /home/services/httpd/html/myadmin/config.inc.php.rpmsave ]; then
126         mv -f /home/services/httpd/html/myadmin/config.inc.php.rpmsave /etc/phpMyAdmin/config.inc.php
127 else
128         if [ -f /home/httpd/html/myadmin/config.inc.php.rpmsave ]; then
129                 mv -f /home/httpd/html/myadmin/config.inc.php.rpmsave /etc/phpMyAdmin/config.inc.php
130         fi
131 fi
132 for i in `grep -lr "/home/\(services/\)*httpd/html/myadmin" /etc/httpd/*`; do
133         cp $i $i.backup
134         %{__perl} -pi -e "s#/home/httpd/html/myadmin#%{_myadmindir}#g" $i
135         %{__perl} -pi -e "s#/home/services/httpd/html/myadmin#%{_myadmindir}#g" $i
136         echo "File changed by trigger: $i (backup: $i.backup)"
137 done
138 if [ -f /var/lock/subsys/httpd ]; then
139         /usr/sbin/apachectl restart 1>&2
140 fi
141
142 %files
143 %defattr(644,root,root,755)
144 %doc Documentation.* CREDITS ChangeLog INSTALL README TODO translators.html scripts
145 %dir %{_sysconfdir}
146 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*
147 %config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
148 %dir %{_myadmindir}
149 %{_myadmindir}/css
150 %{_myadmindir}/themes
151 %{_myadmindir}/scripts
152 %{_myadmindir}/lang
153 %{_myadmindir}/libraries
154 %{_myadmindir}/*.css
155 %{_myadmindir}/*.html
156 %{_myadmindir}/*.php
This page took 0.036179 seconds and 3 git commands to generate.