]>
Commit | Line | Data |
---|---|---|
1 | %define modname ... | |
2 | Summary: Drupal ... Module | |
3 | Name: drupal-mod-%{modname} | |
4 | Version: 4.6.0 | |
5 | Release: 0.1 | |
6 | License: GPL / GPL v2 | |
7 | Group: Applications/WWW | |
8 | Source0: http://drupal.org/files/projects/%{modname}-%{version}.tar.gz | |
9 | # Source0-md5: 0d218124ee86584375d4981ee1646a06 | |
10 | URL: http://drupal.org/project/image | |
11 | # for %%banner | |
12 | #BuildRequires: rpmbuild(macros) >= 1.194 | |
13 | Requires: drupal >= 4.6.0 | |
14 | BuildArch: noarch | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %define _sysconfdir /etc/drupal | |
18 | %define _drupaldir %{_datadir}/drupal | |
19 | %define _moddir %{_drupaldir}/modules | |
20 | %define _incdir %{_drupaldir}/includes | |
21 | %define _htdocs %{_drupaldir}/htdocs | |
22 | %define _podir %{_drupaldir}/po/%{modname} | |
23 | %define _htmlmoddir %{_htdocs}/modules | |
24 | %define _htmlmoddir %{_htdocs}/modules/%{modname} | |
25 | ||
26 | %description | |
27 | ||
28 | %prep | |
29 | %setup -q -n %{modname} | |
30 | #rm -f LICENSE.txt # GPL | |
31 | #rm -f LICENSE.txt # GPL v2 | |
32 | ||
33 | %install | |
34 | rm -rf $RPM_BUILD_ROOT | |
35 | install -d $RPM_BUILD_ROOT{%{_moddir},%{_podir},%{_htmlmoddir},%{_incdir},%{_htdocs}} | |
36 | install -d $RPM_BUILD_ROOT%{_moddir} | |
37 | ||
38 | install *.module $RPM_BUILD_ROOT%{_moddir} | |
39 | install *.inc $RPM_BUILD_ROOT%{_incdir} | |
40 | install *.css $RPM_BUILD_ROOT%{_htmlmoddir} | |
41 | cp -a po/*.po $RPM_BUILD_ROOT%{_podir} | |
42 | ||
43 | %clean | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | ||
46 | %post | |
47 | if [ "$1" = 1 ]; then | |
48 | %banner -e %{name} <<EOF | |
49 | If you want to use localization, then you need to upload .po files | |
50 | from %{_podir} via drupal locatization admin. | |
51 | ||
52 | EOF | |
53 | fi | |
54 | ||
55 | #%post | |
56 | if [ "$1" = 1 ]; then | |
57 | %banner -e %{name} <<EOF | |
58 | To create ... MySQL database tables, import: | |
59 | zcat %{_docdir}/%{name}-%{version}/%{modname}.mysql.gz | mysql drupal | |
60 | For Postgresql file is: | |
61 | %{_docdir}/%{name}-%{version}/%{modname}.pgsql.gz | |
62 | EOF | |
63 | fi | |
64 | ||
65 | %files | |
66 | %defattr(644,root,root,755) | |
67 | %doc *.txt po/*.pot *.php | |
68 | %doc *.txt | |
69 | %doc %{modname}.{mysql,pgsql} | |
70 | %doc %{modname}.mysql | |
71 | %{_moddir}/*.module | |
72 | %{_incdir}/*.inc | |
73 | %{_podir} | |
74 | %{_htmlmoddir}/*.css |