- systemd is history
[packages/dlm.git] / dlm.spec
1 #
2 # Conditional build:
3 %bcond_without  dlm_stonith     # build without fencing helper
4 #
5 Summary:        General-purpose distributed lock manager
6 Summary(pl.UTF-8):      Zarządca rozproszonych blokad ogólnego przeznaczenia
7 Name:           dlm
8 %define         _snap   4283123f0b13eafc46d825050c5142cf44be79c3
9 Version:        4.0.3
10 Release:        1
11 License:        LGPL v2.1+, GPL v2
12 Group:          Libraries
13 Source0:        https://git.fedorahosted.org/cgit/dlm.git/snapshot/%{name}-%{_snap}.tar.bz2
14 # Source0-md5:  575174a0d7b0e1a6e45ec88f447c48cc
15 Source1:        %{name}.init
16 Source2:        %{name}.sysconfig
17 Source4:        dlm.conf
18 Patch0:         no_systemd.patch
19 Patch1:         old_udev_dir.patch
20 URL:            http://sources.redhat.com/cluster/dlm/
21 BuildRequires:  corosync-devel >= 2.0
22 %{?with_dlm_stonith:BuildRequires:      libxml2-devel >= 2.0}
23 %{?with_dlm_stonith:BuildRequires:      pacemaker-devel >= 1.1}
24 BuildRequires:  pkgconfig
25 BuildRequires:  rpmbuild(macros) >= 1.644
26 Requires:       %{name}-libs = %{version}-%{release}
27 Requires:       rc-scripts
28 Requires(post,preun):   /sbin/chkconfig
29 Obsoletes:      cluster-dlm
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 The DLM lock manager is a kernel-based VMS-like distributed lock
34 manager. It is general purpose and not specific to only GFS or CLVM.
35 Kernel and userspace locking API's are available.
36
37 %description -l pl.UTF-8
38 Zarządca blokad DLM to oparty na jądrze zarządca rozproszonych blokad
39 w stylu VMS. Jest ogólnego przeznaczenia, przeznaczonym nie tylko dla
40 GFS-a czy CLVM-a. Dostępne są API blokowania w jądrze i przestrzeni
41 użytkownika.
42
43 %package libs
44 Summary:        DLM libraries
45 Summary(pl.UTF-8):      Biblioteki DLM
46 Group:          Development/Libraries
47 Obsoletes:      cluster-dlm-libs
48
49 %description libs
50 DLM libraries.
51
52 %description libs -l pl.UTF-8
53 Biblioteki DLM.
54
55 %package devel
56 Summary:        Header files and development documentation for DLM
57 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumentacja programisty dla DLM-a
58 Group:          Development/Libraries
59 Requires:       %{name}-libs = %{version}-%{release}
60 Obsoletes:      cluster-dlm-devel
61
62 %description devel
63 Header files and development documentation for DLM.
64
65 %description devel -l pl.UTF-8
66 Pliki nagłówkowe i dokumentacja programisty dla DLM-a.
67
68 %prep
69 %setup -q -n %{name}-%{_snap}
70
71 %patch0 -p1
72 %patch1 -p1
73
74 %build
75 %{__make} \
76         PREFIX=%{_prefix} \
77         LIBNUM=%{_lib} \
78         BINDIR=%{_sbindir} \
79         LIBDIR=%{_libdir} \
80         MANDIR=%{_mandir} \
81         HDRDIR=%{_includedir} \
82         CC="%{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags}"
83
84 %if %{with dlm_stonith}
85 %{__make} -C fence \
86         PREFIX=%{_prefix} \
87         LIBNUM=%{_lib} \
88         BINDIR=%{_sbindir} \
89         LIBDIR=%{_libdir} \
90         MANDIR=%{_mandir} \
91         HDRDIR=%{_includedir} \
92         CC="%{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags}"
93 %endif
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
98                $RPM_BUILD_ROOT%{_sysconfdir}/%{name} \
99                $RPM_BUILD_ROOT/var/run/dlm
100
101 %{__make} install \
102         DESTDIR=$RPM_BUILD_ROOT \
103         PREFIX=%{_prefix} \
104         LIBNUM=%{_lib} \
105         BINDIR=%{_sbindir} \
106         LIBDIR=%{_libdir} \
107         MANDIR=%{_mandir} \
108         HDRDIR=%{_includedir}
109
110 %if %{with dlm_stonith}
111 %{__make} -C fence install \
112         DESTDIR=$RPM_BUILD_ROOT \
113         PREFIX=%{_prefix} \
114         LIBNUM=%{_lib} \
115         BINDIR=%{_sbindir} \
116         LIBDIR=%{_libdir} \
117         MANDIR=%{_mandir} \
118         HDRDIR=%{_includedir}
119 %endif
120
121 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
122 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
123 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128 %post
129
130 %preun
131 /sbin/chkconfig --add %{name}
132 %service %{name} restart
133
134 %postun
135 if [ "$1" = "0" ]; then
136         %service -q %{name} stop
137         /sbin/chkconfig --del %{name}
138 fi
139
140 %post   libs -p /sbin/ldconfig
141 %postun libs -p /sbin/ldconfig
142
143 %files
144 %defattr(644,root,root,755)
145 %doc README.license
146 %{?with_dlm_stonith:%attr(755,root,root) %{_sbindir}/dlm_controld}
147 %attr(755,root,root) %{_sbindir}/dlm_stonith
148 %attr(755,root,root) %{_sbindir}/dlm_tool
149 %dir %{_sysconfdir}/%{name}
150 %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
151 /lib/udev/rules.d/51-dlm.rules
152 %attr(754,root,root) /etc/rc.d/init.d/%{name}
153 %verify(not md5 mtime size) %config(noreplace) /etc/sysconfig/%{name}
154 %{_mandir}/man8/dlm_*.8*
155 %{_mandir}/man5/dlm.conf.5*
156 %dir /var/run/dlm
157
158 %files libs
159 %defattr(644,root,root,755)
160 %attr(755,root,root) %{_libdir}/libdlm.so.3.*
161 %attr(755,root,root) %ghost %{_libdir}/libdlm.so.3
162 %attr(755,root,root) %{_libdir}/libdlm_lt.so.3.*
163 %attr(755,root,root) %ghost %{_libdir}/libdlm_lt.so.3
164 %attr(755,root,root) %{_libdir}/libdlmcontrol.so.3.*
165 %attr(755,root,root) %ghost %{_libdir}/libdlmcontrol.so.3
166
167 %files devel
168 %defattr(644,root,root,755)
169 %attr(755,root,root) %{_libdir}/libdlm.so
170 %attr(755,root,root) %{_libdir}/libdlm_lt.so
171 %attr(755,root,root) %{_libdir}/libdlmcontrol.so
172 %{_includedir}/libdlm.h
173 %{_includedir}/libdlmcontrol.h
174 %{_mandir}/man3/dlm_*.3*
175 %{_mandir}/man3/libdlm.3*
176 %{_pkgconfigdir}/libdlm.pc
177 %{_pkgconfigdir}/libdlm_lt.pc