Source501: packaging/01-dlog.rules
%define upgrade_file_path %{_datadir}/upgrade
+# NOTE: sysconfdir will be passed to ./configure automatically
+%define _sysconfdir %{TZ_SYS_ETC}
BuildRequires: autoconf
BuildRequires: automake
cp %{SOURCE101} .
%autogen --disable-static
-%configure --disable-static \
- TZ_SYS_ETC=%{TZ_SYS_ETC}
-make %{?jobs:-j%jobs} \
- CFLAGS+=-DTZ_SYS_ETC=\\\"%{TZ_SYS_ETC}\\\"
+%configure --disable-static
+make %{?jobs:-j%jobs}
make check
mkdir -p %{buildroot}/usr/share/doc/dlog
cp -r documentation/* %{buildroot}/usr/share/doc/dlog
-mkdir -p %{buildroot}%{TZ_SYS_ETC}
-install -m 0644 configs/dlog.conf.pipe %{buildroot}%{TZ_SYS_ETC}/dlog.conf.pipe
-install -m 0644 configs/dlog.conf.logger %{buildroot}%{TZ_SYS_ETC}/dlog.conf.logger
-
mkdir -p %{buildroot}%{_unitdir}/basic.target.wants/
mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants/
ln -s ../dlog_logger.service %{buildroot}%{_unitdir}/basic.target.wants/dlog_logger.service
%post -n libdlog
/sbin/ldconfig
chsmack -a System /var/log/dlog
-ln -s %{TZ_SYS_ETC}/dlog.conf.pipe %{TZ_SYS_ETC}/dlog.conf
+ln -s %{_sysconfdir}/dlog.conf.pipe %{_sysconfdir}/dlog.conf
%postun -n libdlog
/sbin/ldconfig
-rm %{TZ_SYS_ETC}/dlog.conf
+rm %{_sysconfdir}/dlog.conf
%pre -n dlogbackend-logger
-rm %{TZ_SYS_ETC}/dlog.conf
+rm %{_sysconfdir}/dlog.conf
%post -n dlogbackend-logger
-ln -s %{TZ_SYS_ETC}/dlog.conf.logger %{TZ_SYS_ETC}/dlog.conf
+ln -s %{_sysconfdir}/dlog.conf.logger %{_sysconfdir}/dlog.conf
%postun -n dlogbackend-logger
-rm %{TZ_SYS_ETC}/dlog.conf
-ln -s %{TZ_SYS_ETC}/dlog.conf.pipe %{TZ_SYS_ETC}/dlog.conf
+rm %{_sysconfdir}/dlog.conf
+ln -s %{_sysconfdir}/dlog.conf.pipe %{_sysconfdir}/dlog.conf
%files -n dlogutil
%manifest dlog.manifest
%license LICENSE.APACHE2.0
%{_libdir}/libdlog.so.0
%{_libdir}/libdlog.so.0.0.0
-%attr(664,log,log) %{TZ_SYS_ETC}/dlog.conf.pipe
+%attr(664,log,log) %{_sysconfdir}/dlog.conf.pipe
%attr(755,log,log) /var/log/dlog
%attr(750,log,log) %{_bindir}/dlog_logger
%{_unitdir}/basic.target.wants/dlog_logger.service
%{_udevrulesdir}/01-dlog.rules
# For upgrade
%{upgrade_file_path}/scripts/210.dlog_upgrade.sh
-%attr(644,log,log) %{TZ_SYS_ETC}/dlog.conf.d/
+%attr(644,log,log) %{_sysconfdir}/dlog.conf.d/
%files -n libdlog-devel
%manifest dlog.manifest
%files -n dlogbackend-logger
%manifest dlog.manifest
%license LICENSE.APACHE2.0
-%attr(664,log,log) %{TZ_SYS_ETC}/dlog.conf.logger
+%attr(664,log,log) %{_sysconfdir}/dlog.conf.logger
%files -n log-syslog
%manifest dlog.manifest