SPECS/httpd/httpd.spec
2eadb1f1
 Summary:    The Apache HTTP Server
 Name:       httpd
 Version:    2.4.12
2c824fbf
 Release:    2%{?dist}
2eadb1f1
 License:    Apache License 2.0
 URL:        http://httpd.apache.org/
 Group:      Applications/System
 Vendor:     VMware, Inc.
 Distribution: Photon
2d9b12ea
 Source0:        http://archive.apache.org/dist/httpd/%{name}-%{version}.tar.bz2
3cc43c92
 %define sha1 httpd=bc4681bfd63accec8d82d3cc440fbc8264ce0f17
2eadb1f1
 BuildRequires: openssl
 BuildRequires: openssl-devel
 BuildRequires: pcre-devel
 BuildRequires: apr
 BuildRequires: apr-util
2d9b12ea
 BuildRequires: expat
2eadb1f1
 Requires:   pcre
 Requires:   apr-util
 Requires:   openssl
 %description
 The Apache HTTP Server.
 
2c824fbf
 %package devel
 Summary: Header files for httpd
 Group: Applications/System
 Requires: httpd
 %description devel
 These are the header files of httpd.
 
 %package docs
 Summary: Help files for httpd
 Group: Applications/System
 Requires: httpd
 %description docs
 These are the help files of httpd.
 
2eadb1f1
 %prep
 %setup -q
 %build
2c824fbf
 ./configure --prefix=%{_sysconfdir}/httpd \
             --exec-prefix=%{_prefix} \
             --bindir=%{_bindir}                             \
             --sbindir=%{_sbindir}                           \
             --mandir=%{_mandir}                             \
             --libdir=%{_libdir}                             \
             --sysconfdir=%{_sysconfdir}/httpd/conf          \
             --includedir=%{_includedir}/httpd               \
             --libexecdir=%{_libdir}/httpd/modules           \
             --enable-authnz-fcgi                            \
2eadb1f1
             --enable-mods-shared="all cgi"                  \
             --enable-mpms-shared=all                        \
             --with-apr=%{_prefix}                           \
2c824fbf
             --with-apr-util=%{_prefix}
2eadb1f1
 
 make %{?_smp_mflags}
 
 %install
2c824fbf
 make DESTDIR=%{buildroot} install
 
 install -vdm755 %{buildroot}/usr/lib/systemd/system
 
 cat << EOF >> %{buildroot}/usr/lib/systemd/system/httpd.service
 [Unit]
 Description=The Apache HTTP Server
 After=network.target remote-fs.target nss-lookup.target
 
 [Service]
 Type=notify
 
 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
 KillSignal=SIGWINCH
 KillMode=mixed
 Restart=always
 
 [Install]
 WantedBy=multi-user.target
2eadb1f1
 
2c824fbf
 EOF
2eadb1f1
 
 %post
 /sbin/ldconfig
 if ! getent group apache >/dev/null; then
     groupadd -g 25 apache
 fi
 if ! getent passwd apache >/dev/null; then
     useradd -c "Apache Server" -d /srv/www -g apache \
         -s /bin/false -u 25 apache
 fi
 
 %postun
 /sbin/ldconfig
 if getent passwd apache >/dev/null; then
     userdel apache
 fi
 if getent group apache >/dev/null; then
     groupdel apache
 fi
 
2c824fbf
 %files devel
 %defattr(-,root,root)
 %{_includedir}/*
 
 %files docs
 %defattr(-,root,root)
 %{_sysconfdir}/httpd/manual/*
 
2eadb1f1
 %files
 %defattr(-,root,root)
2c824fbf
 %{_libdir}/*
 %{_bindir}/*
 %{_sbindir}/*
 %{_datadir}/*
 %{_sysconfdir}/httpd/build/*
 %{_sysconfdir}/httpd/cgi-bin/*
 %{_sysconfdir}/httpd/conf/*
 %{_sysconfdir}/httpd/error/*
 %{_sysconfdir}/httpd/htdocs/*
 %{_sysconfdir}/httpd/icons/*
 
2eadb1f1
 
 %changelog
2c824fbf
 *   Thu Jul 16 2015 Touseef Liaqat <tliaqat@vmware.com> 2.4.12-2
 -   Added service file. Changed installation paths.
2eadb1f1
 *   Wed May 20 2015 Touseef Liaqat <tliaqat@vmware.com> 2.4.12-1
 -   Initial build. First version