SHA256
1
0
forked from pool/varnish

feed through spec-beautifier

OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=72
This commit is contained in:
Jan Engelhardt 2016-02-16 12:38:59 +00:00 committed by Git OBS Bridge
parent 85e87699b9
commit 07a078725e

View File

@ -17,19 +17,19 @@
%define library_name libvarnishapi1 %define library_name libvarnishapi1
%define pkg_home %{_localstatedir}/lib/%{name} %define pkg_home %_localstatedir/lib/%name
%define pkg_logdir %{_localstatedir}/log/%{name} %define pkg_logdir %_localstatedir/log/%name
%define pkg_cachedir %{_localstatedir}/cache/%{name} %define pkg_cachedir %_localstatedir/cache/%name
Name: varnish Name: varnish
Version: 4.1.1 Version: 4.1.1
Release: 0 Release: 0
Summary: High-performance HTTP accelerator Summary: High-performance HTTP accelerator
License: BSD-2-Clause License: BSD-2-Clause
Group: Productivity/Networking/Web/Proxy Group: Productivity/Networking/Web/Proxy
Url: http://varnish-cache.org/ URL: http://varnish-cache.org/
#Git-Clone: git://git.varnish-cache.org/varnish-cache #Git-Clone: git://git.varnish-cache.org/varnish-cache
#Git-Web: https://varnish-cache.org/trac/browser #Git-Web: https://varnish-cache.org/trac/browser
Source: https://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz Source: https://repo.varnish-cache.org/source/%name-%version.tar.gz
Source3: varnish.sysconfig Source3: varnish.sysconfig
Source5: varnish.logrotate Source5: varnish.logrotate
Source7: varnish.service Source7: varnish.service
@ -43,8 +43,8 @@ BuildRequires: readline-devel
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: xz BuildRequires: xz
Requires: c_compiler Requires: c_compiler
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %_tmppath/%name-%version-build
Prereq(post): %{_sbindir}/useradd %{_sbindir}/groupadd Prereq(post): %_sbindir/useradd %_sbindir/groupadd
%if 0%{?suse_version} >= 1010 %if 0%{?suse_version} >= 1010
Recommends: logrotate Recommends: logrotate
%endif %endif
@ -59,11 +59,11 @@ given the cached document, or a "fresh" document requested from a backend
server. The purpose of this is to minimize the requests going to the backend server. The purpose of this is to minimize the requests going to the backend
server(s) by serving the same document to potentially many users. server(s) by serving the same document to potentially many users.
%package -n %{library_name} %package -n %library_name
Summary: Shared libraries for Varnish Summary: Shared libraries for Varnish
Group: Productivity/Networking/Web/Proxy Group: Productivity/Networking/Web/Proxy
%description -n %{library_name} %description -n %library_name
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
Proxy) is an application that stores (caches) documents that have been Proxy) is an application that stores (caches) documents that have been
requested over the HTTP protocol. requested over the HTTP protocol.
@ -78,7 +78,7 @@ This package holds the shared libraries for varnish.
%package devel %package devel
Summary: Development files for Varnish Summary: Development files for Varnish
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: %{name} = %{version} Requires: %name = %version
%description devel %description devel
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
@ -96,45 +96,45 @@ This package holds the development files for varnish.
%setup -q %setup -q
%build %build
export CFLAGS="%{optflags} -fstack-protector" export CFLAGS="%optflags -fstack-protector"
%configure --disable-static --docdir="%{_docdir}/%{name}" \ %configure --disable-static --docdir="%_docdir/%name" \
--localstatedir=%{_localstatedir}/cache/ \ --localstatedir=%_localstatedir/cache/ \
--enable-developer-warnings --enable-developer-warnings
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
b="%{buildroot}"; b="%buildroot";
%make_install %make_install
# There is no use for them to normal users # There is no use for them to normal users
mv "$b/%{_bindir}"/* "$b/%{_sbindir}/"; mv "$b/%_bindir"/* "$b/%_sbindir/";
# #
##missing directories ##missing directories
install -dm 0755 "$b"/{%{pkg_logdir},%{pkg_home}}; install -dm 0755 "$b"/{%pkg_logdir,%pkg_home};
install -Dpm 0644 "%{SOURCE5}" "$b/%{_sysconfdir}/logrotate.d/varnish"; install -Dpm 0644 "%SOURCE5" "$b/%_sysconfdir/logrotate.d/varnish";
# #
##init scripts ##init scripts
install -Dpm 0644 "%{SOURCE3}" "$b%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"; install -Dpm 0644 "%SOURCE3" "$b%_localstatedir/adm/fillup-templates/sysconfig.%name";
install -Dpm 0644 "%{SOURCE7}" "$b/%{_unitdir}/varnish.service"; install -Dpm 0644 "%SOURCE7" "$b/%_unitdir/varnish.service";
install -Dpm 0644 "%{SOURCE8}" "$b/%{_unitdir}/varnishlog.service"; install -Dpm 0644 "%SOURCE8" "$b/%_unitdir/varnishlog.service";
mkdir -p "$b/%{_sbindir}"; mkdir -p "$b/%_sbindir";
ln -s service "$b/%{_sbindir}/rcvarnish"; ln -s service "$b/%_sbindir/rcvarnish";
ln -s service "$b/%{_sbindir}/rcvarnishlog"; ln -s service "$b/%_sbindir/rcvarnishlog";
# #
##config files ##config files
mkdir -p "$b/%{_sysconfdir}/%{name}" mkdir -p "$b/%_sysconfdir/%name"
cp "$b/%{_docdir}/%{name}/example.vcl" "$b/%{_sysconfdir}/%{name}/vcl.conf" cp "$b/%_docdir/%name/example.vcl" "$b/%_sysconfdir/%name/vcl.conf"
find %{buildroot} -type f -name "*.la" -delete -print find %buildroot -type f -name "*.la" -delete -print
mkdir -p "$b/%{pkg_logdir}" mkdir -p "$b/%pkg_logdir"
mkdir -p "$b/%{_docdir}/%{name}" mkdir -p "$b/%_docdir/%name"
cp -a ChangeLog LICENSE README "$b/%{_docdir}/%{name}/" cp -a ChangeLog LICENSE README "$b/%_docdir/%name/"
%pre %pre
%{_bindir}/getent group varnish >/dev/null || \ %_bindir/getent group varnish >/dev/null || \
%{_sbindir}/groupadd -r varnish || : %_sbindir/groupadd -r varnish || :
%{_bindir}/getent passwd varnish >/dev/null || \ %_bindir/getent passwd varnish >/dev/null || \
%{_sbindir}/useradd -g varnish -s /bin/false -r -c "user for Varnish" \ %_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
-d %{pkg_home} varnish || : -d %pkg_home varnish || :
%service_add_pre varnish.service %service_add_pre varnish.service
%service_add_pre varnishlog.service %service_add_pre varnishlog.service
@ -150,34 +150,34 @@ cp -a ChangeLog LICENSE README "$b/%{_docdir}/%{name}/"
%service_del_postun varnish.service %service_del_postun varnish.service
%service_del_postun varnishlog.service %service_del_postun varnishlog.service
%post -n %{library_name} -p /sbin/ldconfig %post -n %library_name -p /sbin/ldconfig
%postun -n %{library_name} -p /sbin/ldconfig %postun -n %library_name -p /sbin/ldconfig
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_unitdir}/*.service %_unitdir/*.service
%config(noreplace) %{_sysconfdir}/logrotate.d/varnish %config(noreplace) %_sysconfdir/logrotate.d/varnish
%dir %attr(0750,root,varnish) %{_sysconfdir}/%{name}/ %dir %attr(0750,root,varnish) %_sysconfdir/%name/
%config(noreplace) %attr(0640,root,varnish) %{_sysconfdir}/%{name}/vcl.conf %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf
%{_libdir}/varnish %_libdir/varnish
%{_sbindir}/varnish* %_sbindir/varnish*
%{_sbindir}/rcvarnish* %_sbindir/rcvarnish*
%{_mandir}/man*/* %_mandir/man*/*
%{_docdir}/%{name}/ %_docdir/%name/
%{_datadir}/%{name}/ %_datadir/%name/
%dir %attr(0750,varnish,varnish) %{pkg_home} %dir %attr(0750,varnish,varnish) %pkg_home
%dir %attr(0750,varnish,varnish) %{pkg_cachedir} %dir %attr(0750,varnish,varnish) %pkg_cachedir
%dir %attr(0750,varnish,varnish) %{pkg_logdir} %dir %attr(0750,varnish,varnish) %pkg_logdir
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name} %_localstatedir/adm/fillup-templates/sysconfig.%name
%files -n %{library_name} %files -n %library_name
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_libdir}/libvarnishapi.so.1* %_libdir/libvarnishapi.so.1*
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_includedir}/varnish %_includedir/varnish
%{_datadir}/aclocal/ %_datadir/aclocal/
%{_libdir}/pkgconfig/* %_libdir/pkgconfig/*
%{_libdir}/libvarnishapi.so %_libdir/libvarnishapi.so
%changelog %changelog