]> git.pld-linux.org Git - packages/apache1-mod_ometer.git/blob - apache1-mod_ometer.spec
- use "%(%{apxs} -q SYSCONFDIR)" for _sysconfdir definition
[packages/apache1-mod_ometer.git] / apache1-mod_ometer.spec
1 %define         mod_name        ometer
2 %define         apxs            /usr/sbin/apxs1
3 Summary:        Apache module: Web counter
4 Summary(pl):    Modu³ do Apache: licznik odwiedzin
5 Name:           apache1-mod_%{mod_name}
6 Version:        1.2.0
7 Release:        0.1
8 License:        BSD
9 Group:          Networking/Daemons
10 Source0:        http://www.umich.edu/~umweb/downloads/mod_%{mod_name}-%{version}.tar.gz
11 # Source0-md5:  50b7b641409abd5d1a57077422fd444e
12 Source1:        %{name}.conf
13 Source2:        http://www.umich.edu/~umweb/how-to/cgi-scripts/counter.html
14 # Source2-md5:  6d6f56cec95c5fa2a28caf0ecb86b034
15 Patch0:         %{name}-configure.patch
16 Patch1:         %{name}-symbols.patch
17 URL:            http://modometer.org/
18 BuildRequires:  %{apxs}
19 BuildRequires:  apache1-devel
20 BuildRequires:  libjpeg-devel
21 BuildRequires:  gd-devel
22 Requires(post,preun):   %{apxs}
23 Requires(post,preun):   grep
24 Requires(preun):        fileutils
25 Requires:       apache1
26 Obsoletes:      apache-mod_%{mod_name} <= %{version}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
30 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR)
31
32 %description
33 mod_ometer is a Web counter implemented as an Apache C module. It uses
34 gd to generate its images. gd has some built-in fonts, but you can use
35 any TrueType font you want for the counter. In addition to allowing
36 font choice, mod_ometer has all sorts of options for customizing the
37 size, width, and color of your counter, as well as the ability to
38 output the counter as JPEG or PNG.
39
40 %description -l pl
41 mod_ometer jest licznikiem odwiedzin dzia³aj±cym jako modu³ Apache'a
42 u¿ywaj±cym biblioteki gd do generowania obrazków. gd posiada kilka
43 wbudowanych fontów, lecz w liczniku mo¿na u¿yæ dowolnych fontów
44 TrueType. Poza mo¿liwo¶ci± wyboru kroju czcionki mod_ometer posiada
45 opcje umo¿liwiaj±ce zmianê szeroko¶ci, wysoko¶ci i kolorów licznika
46 oraz formatu obrazka: JPEG lub PNG.
47
48 %prep
49 %setup -q -n mod_%{mod_name}-%{version}
50 %patch0 -p1
51 %patch1 -p1
52 cp %{SOURCE2} .
53
54 %build
55 export LDFLAGS=" "
56 %configure \
57         apxspath=%{apxs}
58 %{__make} \
59         CFLAGS="%{rpmcflags} -I`%{apxs} -q INCLUDEDIR CFLAGS`"
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
64
65 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
66 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %post
72 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
73 if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_ometer.conf" /etc/apache/apache.conf; then
74         echo "Include /etc/apache/mod_ometer.conf" >> /etc/apache/apache.conf
75 fi
76 if [ -f /var/lock/subsys/apache ]; then
77         /etc/rc.d/init.d/apache restart 1>&2
78 fi
79
80 %preun
81 if [ "$1" = "0" ]; then
82         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
83         umask 027
84         grep -v "^Include.*mod_ometer.conf" /etc/apache/apache.conf > \
85                 /etc/apache/apache.conf.tmp
86         mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf
87         if [ -f /var/lock/subsys/apache ]; then
88                 /etc/rc.d/init.d/apache restart 1>&2
89         fi
90 fi
91
92 %files
93 %defattr(644,root,root,755)
94 %doc *.html
95 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mod_ometer.conf
96 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.075874 seconds and 3 git commands to generate.