Blob Blame History Raw
%filter_provides_in %{python_sitearch}.*\.so$
%if %{?fedora}%{!?fedora:0} >= 13
%filter_provides_in %{python3_sitearch}.*\.so$
%endif
%filter_setup

%global with_xrootd %{!?_without_xrootd:1}%{?_without_xrootd:0}

%global with_java %{!?_without_java:1}%{?_without_java:0}
%global with_junit %{!?_without_junit:1}%{?_without_junit:0}

%if %{?rhel}%{!?rhel:0} == 6
%ifarch ppc64
# The python module doesn't build on RHEL6 ppc64 (.toc1 section overflow)
%global with_python 0
%else
%global with_python 1
%endif
%else
%global with_python 1
%endif

%if %{with_python}
%if %{?fedora}%{!?fedora:0}
%global with_pylint %{!?_without_pylint:1}%{?_without_pylint:0}
%else
%global with_pylint 0
%endif
%else
%global with_pylint 0
%endif

%global with_acix 1

%global with_s3 1

%global with_gfal 1

%global with_canl 0

%global with_xmlsec1 %{!?_without_xmlsec1:1}%{?_without_xmlsec1:0}

%global with_sqlite 1

%if %{?fedora}%{!?fedora:0} >= 25 || %{?rhel}%{!?rhel:0} >= 8
%global use_systemd 1
%else
%global use_systemd 0
%endif

%global pkgdir arc

Name:		nordugrid-arc
Version:	5.3.2
Release:	1%{?dist}
Summary:	Advanced Resource Connector Grid Middleware
License:	ASL 2.0
URL:		http://www.nordugrid.org/
Source:		http://download.nordugrid.org/packages/%{name}/releases/%{version}/src/%{name}-%{version}.tar.gz

#		Packages dropped without replacements
Obsoletes:	nordugrid-arc-chelonia < 2.0.0
Obsoletes:	nordugrid-arc-hopi < 2.0.0
Obsoletes:	nordugrid-arc-isis < 2.0.0
Obsoletes:	nordugrid-arc-janitor < 2.0.0
Obsoletes:	nordugrid-arc-doxygen < 4.0.0
%if ! %{with_canl}
Obsoletes:	nordugrid-arc-arcproxyalt < 5.3.0
%endif

BuildRequires:	cppunit-devel
BuildRequires:	pkgconfig
BuildRequires:	libuuid-devel
BuildRequires:	gettext
%if %{with_python}
BuildRequires:	python-devel
%endif
%if %{?fedora}%{!?fedora:0} >= 13
BuildRequires:	python3-devel
%endif
%if %{with_pylint}
BuildRequires:	pylint
%endif
BuildRequires:	glibmm24-devel
BuildRequires:	glib2-devel
BuildRequires:	libxml2-devel
BuildRequires:	openssl
BuildRequires:	openssl-devel
%if %{with_xmlsec1}
BuildRequires:	xmlsec1-devel >= 1.2.4
BuildRequires:	xmlsec1-openssl-devel >= 1.2.4
%endif
BuildRequires:	nss-devel
BuildRequires:	openldap-devel
BuildRequires:	globus-common-devel
BuildRequires:	globus-ftp-client-devel
BuildRequires:	globus-ftp-control-devel
BuildRequires:	globus-gssapi-gsi-devel >= 12.2
%if %{with_canl}
BuildRequires:	canl-c++-devel
%endif
%if %{with_xrootd}
BuildRequires:	xrootd-client-devel
%endif
%if %{with_gfal}
BuildRequires:	gfal2-devel
%endif
%if %{with_s3}
BuildRequires:	libs3-devel
%endif
%if %{?fedora}%{!?fedora:0} >= 15 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires:	libdb-cxx-devel
%else
%if %{?fedora}%{!?fedora:0} == 14
BuildRequires:	libdb-devel
%else
BuildRequires:	db4-devel
%endif
%endif
%if %{with_java}
BuildRequires:	java-devel >= 1.5.0
BuildRequires:	jpackage-utils
%if %{with_junit}
BuildRequires:	junit
%endif
%endif
BuildRequires:	perl-generators
# Needed for Boinc backend testing during make check
BuildRequires:	perl(DBI)
# Needed for infoprovider testing during make check
BuildRequires:	perl(XML::Simple)
# Needed for LRMS testing during make check
BuildRequires:	perl(Test::Harness)
BuildRequires:	perl(Test::Simple)
BuildRequires:	mktemp
# Needed to run ACIX unit tests
%if %{with_acix}
BuildRequires:	python-twisted-core
BuildRequires:	python-twisted-web
BuildRequires:	pyOpenSSL
%endif
BuildRequires:	selinux-policy-devel
BuildRequires:	checkpolicy
BuildRequires:	swig
BuildRequires:	libtool-ltdl-devel
%if %{with_sqlite}
BuildRequires:	sqlite-devel >= 3.6
%endif
%if %{use_systemd}
BuildRequires:	systemd-units
%endif

%description
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The Advanced Resource Connector (ARC) brings computing resources
together across institutional boundaries. This concept is commonly
referred to as a "computational grid". Historically, grids address the
organization of distributed storage of data and parallel computation,
but could be expanded to arbitrary services.

Just like the web, ARC has its roots in the IT infrastructure that was
erected to analyze the experiments for high energy physics at CERN.
The first release, ARC-0.x, was dependent on Globus, the current
release keeps that compatibility but can also be used independently.

%package client
Summary:	ARC command line interface
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}

%description client
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

For the regular user of any ARC-based computational grid,
this client package contains (or depends on) all packages
that are needed to submit jobs, query their status and
retrieve results.

%package hed
Summary:	ARC Hosting Environment Daemon
Requires:	%{name} = %{version}-%{release}

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description hed
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The ARC Hosting Environment Daemon (HED). This daemon is a container for
ARC services.

%package gridftpd
Summary:	ARC gridftp server
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-globus

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description gridftpd
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the ARC gridftp server which has a plugin framework.
Current plugins include:

  fileplugin : Standard gridftp server based on Globus globus-ftp-control
  jobplugin  : Classical ARC job submission interface

%package cache-service
Summary:	ARC cache service
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-hed = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description cache-service
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the ARC cache service. It provides a way to perform
some operations on the A-REX cache remotely. It can be especially helpful
for data management within a pilot job framework.

%package datadelivery-service
Summary:	ARC data delivery service
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-hed = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description datadelivery-service
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the ARC data delivery service.

%package ldap-infosys
Summary:	ARC LDAP information service
BuildArch:	noarch
Requires:	openldap-servers
Requires:	glue-schema >= 2.0.10
Requires:	bdii

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 8
Requires(post):		policycoreutils-python-utils
Requires(postun):	policycoreutils-python-utils
%else
Requires(post):		policycoreutils-python
Requires(postun):	policycoreutils-python
%endif

%description ldap-infosys
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the LDAP based information system for ARC.
This package is not self-contained. it should be pulled in by either
nordugrid-arc-arex to be a part of a local information system or by
nordugrid-arc-egiis to be a part of a EGIIS service.

%package aris
Summary:	ARC local information system
Requires:	%{name}-ldap-infosys = %{version}-%{release}
Requires:	bdii
BuildArch:	noarch
Requires:	openldap-servers
Requires:	glue-schema >= 2.0.10
Requires:	bdii

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 8
Requires(post):		policycoreutils-python-utils
Requires(postun):	policycoreutils-python-utils
%else
Requires(post):		policycoreutils-python
Requires(postun):	policycoreutils-python
%endif

%description aris
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the LDAP based information system for ARC.
This package is not self-contained but is closely connected to
nordugrid-arc-arex.

%package egiis
Summary:	ARC EGIIS service
Requires:	%{name}-ldap-infosys = %{version}-%{release}
Requires:	openldap-servers
Requires:	glue-schema >= 2.0.10

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

Requires(post):		policycoreutils
Requires(postun):	policycoreutils

%description egiis
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The EGIIS is the Information Index Service used by ARC, This service is
used to set up a ldap-based server that local information systems register
to.

%package ldap-monitor
Summary:	ARC LDAP monitor service
Requires:	%{name} = %{version}-%{release}
Requires:	php
Requires:	php-gd
Requires:	php-ldap
BuildArch:	noarch

%description ldap-monitor
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the LDAP monitor system for ARC.
This package is self-contained. It is used to set up a web-based monitor
which pulls information from a EGIIS and shows it graphically.

%package ws-monitor
Summary:	ARC WS monitor service
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description ws-monitor
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the WS monitor system for ARC.
This package is self-contained. It is used to set up a web-based monitor
which pulls information from ISIS and shows it graphically.

%package arex
Summary:	ARC Remote EXecution service
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-hed = %{version}-%{release}
Requires:	%{name}-ldap-infosys = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}
%if %{with_python}
Requires:	%{name}-python = %{version}-%{release}
%endif
Requires:	mktemp
%if %{?fedora}%{!?fedora:0} >= 26 || %{?rhel}%{!?rhel:0} >= 8
Requires:	python2-stomppy
%else
Requires:	stomppy
%endif
Requires:	python-ldap
Requires:	python-dirq

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description arex
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The ARC Remote EXecution service (AREX) provides a service for the
execution of compute jobs and the transfer of input or output data.

%package plugins-needed
Summary:	ARC base plugins
Requires:	%{name} = %{version}-%{release}

%description plugins-needed
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC base plugins. This includes the Message Chain Components (MCCs) and
Data Manager Components (DMCs).

%package plugins-globus
Summary:	ARC Globus plugins
Requires:	%{name} = %{version}-%{release}
Requires:	globus-gssapi-gsi >= 12.2

%description plugins-globus
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC Globus plugins. This includes the Globus dependent Data Manager
Components (DMCs).

%if %{with_canl}
%package arcproxyalt
Summary:	ARC proxy client based on canl
Requires:	%{name} = %{version}-%{release}

%description arcproxyalt
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package includes a preview of the arcproxy command based on canl.
%endif

%if %{with_xrootd}
%package plugins-xrootd
Summary:	ARC xrootd plugins
Requires:	%{name} = %{version}-%{release}

%description plugins-xrootd
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC xrootd plugins. These allow access to data through the xrootd protocol.
%endif

%if %{with_gfal}
%package plugins-gfal
Summary:	ARC GFAL plugins
Requires:	%{name} = %{version}-%{release}

%description plugins-gfal
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC plugins for GFAL2. This allows third-party transfer and adds support
for several extra transfer protocols (rfio, dcap, gsidcap). Specific
protocol support is provided by separate gfal2-plugin packages.
%endif

%if %{with_s3}
%package plugins-s3
Summary:	ARC S3 plugins
Requires:	%{name} = %{version}-%{release}

%description plugins-s3
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC plugins for S3. These allow access to data through the S3 protocol.
%endif

%if %{with_acix}
%package acix-core
Summary:	ARC cache index - core
BuildArch:	noarch
Requires:	python-twisted-core
Requires:	python-twisted-web
Requires:	pyOpenSSL

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description acix-core
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Core components of the ARC Cache Index (ACIX).

%package acix-cache
Summary:	ARC cache index - cache server
BuildArch:	noarch
Requires:	python-twisted-core
Requires:	python-twisted-web
Requires:	pyOpenSSL
Requires:	%{name}-acix-core = %{version}-%{release}

%if %{use_systemd}
Requires(post):		systemd-units
Requires(preun):	systemd-units
Requires(postun):	systemd-units
%else
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts
%endif

%description acix-cache
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Cache server component of the ARC Cache Index (ACIX), usually installed
alongside A-REX. This component collects information on the content of
an A-REX cache.

%package acix-index
Summary:	ARC cache index - index server
BuildArch:	noarch
Requires:	python-twisted-core
Requires:	python-twisted-web
Requires:	pyOpenSSL
Requires:	%{name}-acix-core = %{version}-%{release}

%description acix-index
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Index server component of the ARC Cache Index (ACIX), usually installed
independently of any A-REX installation. This component pulls cache content
from cache servers and can be queried by clients for the location of cached
files.
%endif

%package devel
Summary:	ARC development files
Requires:	%{name} = %{version}-%{release}
Requires:	glibmm24-devel
Requires:	glib2-devel
Requires:	libxml2-devel
Requires:	openssl-devel

%description devel
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Header files and libraries needed to develop applications using ARC.

%if %{with_python}
%package python
Summary:	ARC Python wrapper
Requires:	%{name} = %{version}-%{release}

%description python
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Python bindings for ARC.
%endif

%if %{?fedora}%{!?fedora:0} >= 13
%package python3
Summary:	ARC Python wrapper
Requires:	%{name} = %{version}-%{release}

%description python3
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Python bindings for ARC.
%endif

%if %{with_java}
%package java
Summary:	ARC Java wrapper
Requires:	%{name} = %{version}-%{release}
%if %{?fedora}%{!?fedora:0} >= 20 || %{?rhel}%{!?rhel:0} >= 7
Requires:	java-headless
%else
Requires:	java
%endif
Requires:	jpackage-utils

%description java
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Java bindings for ARC.
%endif

%package gridmap-utils
Summary:	NorduGrid authorization tools
Requires:	perl(Crypt::SSLeay)
Requires:	perl(SOAP::Lite)
Requires:	perl(Crypt::OpenSSL::X509)
Requires:	crontabs
BuildArch:	noarch

%description gridmap-utils
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the ARC authorization machinery.
A prominent tool distributed in this package is the nordugridmap
script to collect user information from the virtual organizations.

%package ca-utils
Summary:	NorduGrid authentication tools
Requires:	fetch-crl
Requires(post):	fetch-crl
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
Requires(post):	systemd-units
%else
Requires(post):	chkconfig
%endif
BuildArch:	noarch

%description ca-utils
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The nordugrid-arc-ca-utils packages has been obsoleted.
The functionality of the grid-update-crls tool is provided by the
fetch-crl tool in the fetch-crl package.

%package misc-utils
Summary:	NorduGrid misc tools
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}

%description misc-utils
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains utilities for various tasks including testing. The
package is usually not required by users or sysadmins but is mainly for
developers.

%prep
%setup -q

%build
%configure --disable-static \
%if ! %{with_java}
     --disable-java \
%endif
%if ! %{with_python}
     --disable-swig-python \
%endif
%if ! %{with_acix}
     --disable-acix \
%endif
%if %{with_gfal}
     --enable-gfal \
%endif
%if %{with_s3}
     --enable-s3 \
%endif
%if %{?fedora}%{!?fedora:0} >= 13
     --with-altpython=python3 \
%endif
%if %{with_canl}
     --enable-canlxx \
%endif
%if ! %{with_xrootd}
     --disable-xrootd \
%endif
%if %{with_sqlite}
     --enable-sqlite \
%endif
%if %{use_systemd}
     --with-systemd-units-location=%{_unitdir} \
%endif
     --disable-doc \
     --with-docdir=%{_pkgdocdir} \
     --with-jnidir=%{_jnidir}

make %{?_smp_mflags}

cd selinux
make -f /usr/share/selinux/devel/Makefile
cd -

%check
make check

%install
make install DESTDIR=%{buildroot}

# Install Logrotate.
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -p -m 644 debian/%{name}-arex.logrotate \
    %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-arex
install -p -m 644 debian/%{name}-gridftpd.logrotate \
    %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-gridftpd
install -p -m 644 debian/%{name}-aris.logrotate \
    %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-aris
install -p -m 644 debian/%{name}-datadelivery-service.logrotate \
    %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-datadelivery-service

find %{buildroot} -type f -name \*.la -exec rm -fv '{}' ';'

# The py-compile script in the source tarball is old (RHEL 6)
# It does the wrong thing for python 3 - remove and let rpmbuild do it right
find %{buildroot} -type f -name \*.pyc -exec rm -fv '{}' ';'
find %{buildroot} -type f -name \*.pyo -exec rm -fv '{}' ';'

# libarcglobusutils is not part of the ARC api.
find %{buildroot} -name libarcglobusutils.so -exec rm -fv '{}' ';'

%if ! %{use_systemd}
# Turn off default enabling of the services
sed -e 's/\(chkconfig: \) *[^ ]*/\1-/' \
    -e '/Default-Start/d' \
    -e 's/\(Default-Stop:\s*\).*/\10 1 2 3 4 5 6/' \
    -i %{buildroot}%{_initrddir}/*
%endif

# Create log directory
mkdir -p %{buildroot}%{_localstatedir}/log/arc

# Create spool directories for Jura
mkdir -p %{buildroot}%{_localstatedir}/spool/arc
mkdir -p %{buildroot}%{_localstatedir}/spool/arc/ssm
mkdir -p %{buildroot}%{_localstatedir}/spool/arc/urs

%find_lang %{name}

cd selinux
mkdir -p %{buildroot}%{_datadir}/selinux/packages/%{name}
install -p -m 644 %{name}-egiis.pp \
    %{buildroot}%{_datadir}/selinux/packages/%{name}
cd -

# Remove examples and let RPM package them under /usr/share/doc using the doc macro
rm -rf %{buildroot}%{_datadir}/%{pkgdir}/examples
make -C src/libs/data-staging/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/libs/compute/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/libs/data/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/acc/PythonBroker	DESTDIR=$PWD/docdir/python pkgdatadir= install-exampleDATA
make -C python/examples			DESTDIR=$PWD/docdir/python pkgdatadir= install-exampleDATA
make -C java/examples			DESTDIR=$PWD/docdir/java   pkgdatadir= install-exampleDATA
make -C src/clients			DESTDIR=$PWD/docdir/client pkgdatadir= install-exampleDATA
make -C src/tests/echo			DESTDIR=$PWD/docdir/hed	   pkgdatadir= install-exampleDATA
make -C src/hed				DESTDIR=$PWD/docdir/hed	   pkgdatadir= install-profileDATA

# arc.conf.reference needs special handling
make -C src/doc DESTDIR=%{buildroot} install-exampleDATA

# Link to arc.conf.reference from doc
rm -f $PWD/docdir/arc.conf.reference
ln -s %{_datadir}/%{pkgdir}/examples/arc.conf.reference $PWD/docdir/arc.conf.reference

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post plugins-globus -p /sbin/ldconfig

%postun plugins-globus -p /sbin/ldconfig

%if %{use_systemd}

%pre hed
# Remove old init config when systemd is used
/sbin/chkconfig --del arched >/dev/null 2>&1 || :

%post hed
%systemd_post arched.service

%preun hed
%systemd_preun arched.service

%postun hed
%systemd_postun_with_restart arched.service

%else

%post hed
/sbin/chkconfig --add arched

%preun hed
if [ $1 -eq 0 ]; then
  service arched stop > /dev/null 2>&1
  /sbin/chkconfig --del arched
fi

%postun hed
if [ $1 -ge 1 ]; then
  service arched condrestart > /dev/null 2>&1
fi

%endif

%if %{use_systemd}

%pre arex
# Remove old init config when systemd is used
/sbin/chkconfig --del a-rex >/dev/null 2>&1 || :

%post arex
%systemd_post a-rex.service

%preun arex
%systemd_preun a-rex.service

%postun arex
%systemd_postun_with_restart a-rex.service

%else

%post arex
/sbin/chkconfig --add a-rex

%preun arex
if [ $1 -eq 0 ]; then
  service a-rex stop > /dev/null 2>&1
  /sbin/chkconfig --del a-rex
fi

%postun arex
if [ $1 -ge 1 ]; then
  service a-rex condrestart > /dev/null 2>&1
fi

%endif

%if %{use_systemd}

%pre gridftpd
# Remove old init config when systemd is used
/sbin/chkconfig --del gridftpd >/dev/null 2>&1 || :

%post gridftpd
%systemd_post gridftpd.service

%preun gridftpd
%systemd_preun gridftpd.service

%postun gridftpd
%systemd_postun_with_restart gridftpd.service

%else

%post gridftpd
/sbin/chkconfig --add gridftpd

%preun gridftpd
if [ $1 -eq 0 ]; then
  service gridftpd stop > /dev/null 2>&1
  /sbin/chkconfig --del gridftpd
fi

%postun gridftpd
if [ $1 -ge 1 ]; then
  service gridftpd condrestart > /dev/null 2>&1
fi

%endif

%if %{use_systemd}

%pre cache-service
# Remove old init config when systemd is used
/sbin/chkconfig --del arc-cache-service >/dev/null 2>&1 || :

%post cache-service
%systemd_post arc-cache-service.service

%preun cache-service
%systemd_preun arc-cache-service.service

%postun cache-service
%systemd_postun_with_restart arc-cache-service.service

%else

%post cache-service
/sbin/chkconfig --add arc-cache-service

%preun cache-service
if [ $1 -eq 0 ]; then
  service arc-cache-service stop > /dev/null 2>&1
  /sbin/chkconfig --del arc-cache-service
fi

%postun cache-service
if [ $1 -ge 1 ]; then
  service arc-cache-service condrestart > /dev/null 2>&1
fi

%endif

%if %{use_systemd}

%pre datadelivery-service
# Remove old init config when systemd is used
/sbin/chkconfig --del arc-datadelivery-service >/dev/null 2>&1 || :

%post datadelivery-service
%systemd_post arc-datadelivery-service.service

%preun datadelivery-service
%systemd_preun arc-datadelivery-service.service

%postun datadelivery-service
%systemd_postun_with_restart arc-datadelivery-service.service

%else

%post datadelivery-service
/sbin/chkconfig --add arc-datadelivery-service

%preun datadelivery-service
if [ $1 -eq 0 ]; then
  service arc-datadelivery-service stop > /dev/null 2>&1
  /sbin/chkconfig --del arc-datadelivery-service
fi

%postun datadelivery-service
if [ $1 -ge 1 ]; then
  service arc-datadelivery-service condrestart > /dev/null 2>&1
fi

%endif

%if %{use_systemd}

%pre ldap-infosys
# Remove old init config when systemd is used
/sbin/chkconfig --del nordugrid-arc-slapd >/dev/null 2>&1 || :
/sbin/chkconfig --del nordugrid-arc-inforeg >/dev/null 2>&1 || :

%post ldap-infosys
%systemd_post nordugrid-arc-slapd.service nordugrid-arc-inforeg.service
semanage port -a -t ldap_port_t -p tcp 2135 2>/dev/null || :
semanage fcontext -a -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :

%preun ldap-infosys
%systemd_preun nordugrid-arc-slapd.service nordugrid-arc-inforeg.service

%postun ldap-infosys
%systemd_postun_with_restart nordugrid-arc-slapd.service nordugrid-arc-inforeg.service
if [ $1 -eq 0 ]; then
  semanage port -d -t ldap_port_t -p tcp 2135 2>/dev/null || :
  semanage fcontext -d -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :
fi

%else

%post ldap-infosys
/sbin/chkconfig --add nordugrid-arc-slapd
/sbin/chkconfig --add nordugrid-arc-inforeg
semanage port -a -t ldap_port_t -p tcp 2135 2>/dev/null || :
semanage fcontext -a -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :

%preun ldap-infosys
if [ $1 -eq 0 ]; then
  service nordugrid-arc-slapd stop > /dev/null 2>&1
  service nordugrid-arc-inforeg stop > /dev/null 2>&1
  /sbin/chkconfig --del nordugrid-arc-slapd
  /sbin/chkconfig --del nordugrid-arc-inforeg
fi

%postun ldap-infosys
if [ $1 -ge 1 ]; then
  service nordugrid-arc-slapd condrestart > /dev/null 2>&1
  service nordugrid-arc-inforeg condrestart > /dev/null 2>&1
fi
if [ $1 -eq 0 ]; then
  semanage port -d -t ldap_port_t -p tcp 2135 2>/dev/null || :
  semanage fcontext -d -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :
fi

%endif

%if %{use_systemd}

%pre aris
# Remove old init config when systemd is used
/sbin/chkconfig --del nordugrid-arc-bdii >/dev/null 2>&1 || :

%post aris
%systemd_post nordugrid-arc-bdii.service
semanage fcontext -a -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
semanage fcontext -a -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
# Remove selinux labels for old arc bdii var dir
semanage fcontext -d -t slapd_db_t "/var/run/arc/bdii(/.*)?" 2>/dev/null || :

%preun aris
%systemd_preun nordugrid-arc-bdii.service

%postun aris
%systemd_postun_with_restart nordugrid-arc-bdii.service
if [ $1 -eq 0 ]; then
  semanage fcontext -d -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
  semanage fcontext -d -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
fi

%triggerun aris -- bdii
systemctl try-restart nordugrid-arc-bdii.service >/dev/null 2>&1 || :

%else

%post aris
/sbin/chkconfig --add nordugrid-arc-bdii
semanage fcontext -a -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
semanage fcontext -a -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
# Remove selinux labels for old arc bdii var dir
semanage fcontext -d -t slapd_db_t "/var/run/arc/bdii(/.*)?" 2>/dev/null || :

%preun aris
if [ $1 -eq 0 ]; then
  service nordugrid-arc-bdii stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del nordugrid-arc-bdii
fi

%postun aris
if [ $1 -ge 1 ]; then
  service nordugrid-arc-bdii condrestart > /dev/null 2>&1 || :
fi
if [ $1 -eq 0 ]; then
  semanage fcontext -d -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
  semanage fcontext -d -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
fi

%triggerun aris -- bdii
service nordugrid-arc-bdii condrestart > /dev/null 2>&1 || :

%endif

%if %{use_systemd}

%pre egiis
# Remove old init config when systemd is used
/sbin/chkconfig --del nordugrid-arc-egiis >/dev/null 2>&1 || :

%post egiis
%systemd_post nordugrid-arc-egiis.service
/usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-egiis.pp > /dev/null 2>&1 || :
/sbin/restorecon %{_sbindir}/arc-infoindex-relay

%preun egiis
%systemd_preun nordugrid-arc-egiis.service

%postun egiis
%systemd_postun_with_restart nordugrid-arc-egiis.service
if [ $1 -eq 0 ] ; then
  /usr/sbin/semodule -r %{name}-egiis > /dev/null 2>&1 || :
fi

%else

%post egiis
/sbin/chkconfig --add nordugrid-arc-egiis
/usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-egiis.pp > /dev/null 2>&1 || :
/sbin/restorecon %{_sbindir}/arc-infoindex-relay

%preun egiis
if [ $1 -eq 0 ]; then
  service nordugrid-arc-egiis stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del nordugrid-arc-egiis
fi

%postun egiis
if [ $1 -ge 1 ]; then
  service nordugrid-arc-egiis condrestart > /dev/null 2>&1 || :
fi
if [ $1 -eq 0 ] ; then
  /usr/sbin/semodule -r %{name}-egiis > /dev/null 2>&1 || :
fi

%endif

%if %{with_acix}

%if %{use_systemd}

%pre acix-cache
# Remove old init config when systemd is used
/sbin/chkconfig --del acix-cache >/dev/null 2>&1 || :

%post acix-cache
%systemd_post acix-cache.service

%preun acix-cache
%systemd_preun acix-cache.service

%postun acix-cache
%systemd_postun_with_restart acix-cache.service

%else

%post acix-cache
/sbin/chkconfig --add acix-cache

%preun acix-cache
if [ $1 -eq 0 ]; then
  service acix-cache stop > /dev/null 2>&1
  /sbin/chkconfig --del acix-cache
fi

%postun acix-cache
if [ $1 -ge 1 ]; then
  service acix-cache condrestart > /dev/null 2>&1 || :
fi

%endif

%if %{use_systemd}

%pre acix-index
# Remove old init config when systemd is used
/sbin/chkconfig --del acix-index >/dev/null 2>&1 || :

%post acix-index
%systemd_post acix-index.service

%preun acix-index
%systemd_preun acix-index.service

%postun acix-index
%systemd_postun_with_restart acix-index.service

%else

%post acix-index
/sbin/chkconfig --add acix-index

%preun acix-index
if [ $1 -eq 0 ]; then
  service acix-index stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del acix-index
fi

%postun acix-index
if [ $1 -ge 1 ]; then
  service acix-index condrestart > /dev/null 2>&1 || :
fi

%endif

%endif

%post ca-utils
# Enable and start CRL updates via cron for backward compatibility
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
systemctl enable fetch-crl-cron.service >/dev/null 2>&1 || :
systemctl start fetch-crl-cron.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig fetch-crl-cron on
service fetch-crl-cron start > /dev/null 2>&1
%endif

%files -f %{name}.lang
%{!?_licensedir: %doc docdir/arc.conf.reference README AUTHORS LICENSE NOTICE ChangeLog}
%{?_licensedir: %doc docdir/arc.conf.reference README AUTHORS ChangeLog}
%{?_licensedir: %license LICENSE NOTICE}
%dir %{_libdir}/%{pkgdir}
%dir %{_libexecdir}/%{pkgdir}
%{_libdir}/libarccompute.so.*
%{_libdir}/libarccommunication.so.*
%{_libdir}/libarccommon.so.*
%{_libdir}/libarccredential.so.*
%{_libdir}/libarccredentialstore.so.*
%{_libdir}/libarccrypto.so.*
%{_libdir}/libarcdata.so.*
%{_libdir}/libarcdatastaging.so.*
%{_libdir}/%{pkgdir}/DataStagingDelivery
%{_libdir}/libarcloader.so.*
%{_libdir}/libarcmessage.so.*
%{_libdir}/libarcsecurity.so.*
%{_libdir}/libarcinfosys.so.*
%{_libdir}/libarcws.so.*
%{_libdir}/libarcwssecurity.so.*
%if %{with_xmlsec1}
%{_libdir}/libarcxmlsec.so.*
%endif
# We need to have libmodcrypto.so close to libarccrypto
%{_libdir}/%{pkgdir}/libmodcrypto.so
%{_libdir}/%{pkgdir}/libmodcrypto.apd
# We need to have libmodcredential.so close to libarccredential
%{_libdir}/%{pkgdir}/libmodcredential.so
%{_libdir}/%{pkgdir}/libmodcredential.apd
%{_libdir}/%{pkgdir}/arc-file-access
%{_libdir}/%{pkgdir}/arc-hostname-resolver
%dir %{_datadir}/%{pkgdir}/examples
%{_datadir}/%{pkgdir}/examples/arc.conf.reference
%dir %{_datadir}/%{pkgdir}/test-jobs
%{_datadir}/%{pkgdir}/test-jobs/test-job-*
%{_datadir}/%{pkgdir}/schema
%dir %{_datadir}/%{pkgdir}

%files client
%doc docdir/client/*
%{_bindir}/arccat
%{_bindir}/arcclean
%{_bindir}/arccp
%{_bindir}/arcecho
%{_bindir}/arcget
%{_bindir}/arcinfo
%{_bindir}/arckill
%{_bindir}/arcls
%{_bindir}/arcmkdir
%{_bindir}/arcrename
%{_bindir}/arcproxy
%{_bindir}/arcrenew
%{_bindir}/arcresub
%{_bindir}/arcresume
%{_bindir}/arcrm
%{_bindir}/arcstat
%{_bindir}/arcsub
%{_bindir}/arcsync
%{_bindir}/arctest
%dir %{_sysconfdir}/%{pkgdir}
%config(noreplace) %{_sysconfdir}/%{pkgdir}/client.conf
%doc %{_mandir}/man1/arccat.1*
%doc %{_mandir}/man1/arcclean.1*
%doc %{_mandir}/man1/arccp.1*
%doc %{_mandir}/man1/arcecho.1*
%doc %{_mandir}/man1/arcget.1*
%doc %{_mandir}/man1/arcinfo.1*
%doc %{_mandir}/man1/arckill.1*
%doc %{_mandir}/man1/arcls.1*
%doc %{_mandir}/man1/arcmkdir.1*
%doc %{_mandir}/man1/arcrename.1*
%doc %{_mandir}/man1/arcproxy.1*
%doc %{_mandir}/man1/arcrenew.1*
%doc %{_mandir}/man1/arcresub.1*
%doc %{_mandir}/man1/arcresume.1*
%doc %{_mandir}/man1/arcrm.1*
%doc %{_mandir}/man1/arcstat.1*
%doc %{_mandir}/man1/arcsub.1*
%doc %{_mandir}/man1/arcsync.1*
%doc %{_mandir}/man1/arctest.1*

%files hed
%doc docdir/hed/*
%if %{use_systemd}
%{_unitdir}/arched.service
%{_datadir}/%{pkgdir}/arched-start
%else
%{_initrddir}/arched
%endif
%{_sbindir}/arched
%{_libdir}/%{pkgdir}/libecho.so
%{_libdir}/%{pkgdir}/libecho.apd
%{_datadir}/%{pkgdir}/profiles
%doc %{_mandir}/man8/arched.8*
%doc %{_mandir}/man5/arc.conf.5*

%files gridftpd
%if %{use_systemd}
%{_unitdir}/gridftpd.service
%{_datadir}/%{pkgdir}/gridftpd-start
%else
%{_initrddir}/gridftpd
%endif
%{_sbindir}/gridftpd
%{_libdir}/%{pkgdir}/jobplugin.*
%{_libdir}/%{pkgdir}/fileplugin.*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-gridftpd
%doc %{_mandir}/man8/gridftpd.8*

%files ldap-infosys
%if %{use_systemd}
%{_unitdir}/nordugrid-arc-slapd.service
%{_unitdir}/nordugrid-arc-inforeg.service
%else
%{_initrddir}/nordugrid-arc-ldap-infosys
%{_initrddir}/nordugrid-arc-slapd
%{_initrddir}/nordugrid-arc-inforeg
%endif
%{_datadir}/%{pkgdir}/create-slapd-config
%{_datadir}/%{pkgdir}/create-inforeg-config
%{_datadir}/%{pkgdir}/config_parser_compat.sh
%{_datadir}/%{pkgdir}/grid-info-soft-register
%{_datadir}/%{pkgdir}/ldap-schema

%files aris
%if %{use_systemd}
%{_unitdir}/nordugrid-arc-bdii.service
%else
%{_initrddir}/nordugrid-arc-bdii
%endif
%{_datadir}/%{pkgdir}/create-bdii-config
%{_datadir}/%{pkgdir}/glue-generator.pl
%{_datadir}/%{pkgdir}/glite-info-provider-ldap
%{_datadir}/%{pkgdir}/PerfData.pl
%{_datadir}/%{pkgdir}/ConfigParser.pm
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-aris

%files egiis
%if %{use_systemd}
%{_unitdir}/nordugrid-arc-egiis.service
%else
%{_initrddir}/nordugrid-arc-egiis
%endif
%{_sbindir}/arc-infoindex-relay
%{_sbindir}/arc-infoindex-server
%{_mandir}/man8/arc-infoindex-relay.8*
%{_mandir}/man8/arc-infoindex-server.8*
%{_libdir}/%{pkgdir}/arc-infoindex-slapd-wrapper.so
%{_libdir}/%{pkgdir}/arc-infoindex-slapd-wrapper.apd
%{_datadir}/selinux/packages/%{name}

%files ldap-monitor
%{_datadir}/%{pkgdir}/ldap-monitor
%doc %{_mandir}/man7/ldap-monitor.7*

%files ws-monitor
%{_datadir}/%{pkgdir}/ws-monitor
%doc %{_mandir}/man7/ws-monitor.7*

%files cache-service
%if %{use_systemd}
%{_unitdir}/arc-cache-service.service
%{_datadir}/%{pkgdir}/arc-cache-service-start
%else
%{_initrddir}/arc-cache-service
%endif
%{_libdir}/%{pkgdir}/libcacheservice.so
%{_libdir}/%{pkgdir}/libcacheservice.apd

%files datadelivery-service
%if %{use_systemd}
%{_unitdir}/arc-datadelivery-service.service
%{_datadir}/%{pkgdir}/arc-datadelivery-service-start
%else
%{_initrddir}/arc-datadelivery-service
%endif
%{_libdir}/%{pkgdir}/libdatadeliveryservice.so
%{_libdir}/%{pkgdir}/libdatadeliveryservice.apd
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-datadelivery-service

%files arex
%if %{use_systemd}
%{_unitdir}/a-rex.service
%{_datadir}/%{pkgdir}/a-rex-start
%else
%{_initrddir}/a-rex
%endif
%{_sbindir}/a-rex-backtrace-collect
%{_libexecdir}/%{pkgdir}/arc-blahp-logger
%{_libexecdir}/%{pkgdir}/arc-config-check
%{_libexecdir}/%{pkgdir}/arc-vomsac-check
%{_libexecdir}/%{pkgdir}/cache-clean
%{_libexecdir}/%{pkgdir}/cache-list
%{_libexecdir}/%{pkgdir}/downloader
%if %{with_sqlite}
%{_libexecdir}/%{pkgdir}/gm-delegations-converter
%endif
%{_libexecdir}/%{pkgdir}/gm-jobs
%{_libexecdir}/%{pkgdir}/gm-kick
%{_libexecdir}/%{pkgdir}/inputcheck
%{_libexecdir}/%{pkgdir}/jura
%{_libexecdir}/%{pkgdir}/smtp-send
%{_libexecdir}/%{pkgdir}/smtp-send.sh
%{_libexecdir}/%{pkgdir}/uploader
%{_datadir}/%{pkgdir}/cancel-*-job
%{_datadir}/%{pkgdir}/scan-*-job
%{_datadir}/%{pkgdir}/submit-*-job
%{_datadir}/%{pkgdir}/DGAuthplug.py*
%{_datadir}/%{pkgdir}/DGBridgeDataPlugin.py*
%{_datadir}/%{pkgdir}/DGLog2XML.py*
%{_libdir}/%{pkgdir}/libarex.so
%{_libdir}/%{pkgdir}/libarex.apd
%{_datadir}/%{pkgdir}/CEinfo.pl
%{_datadir}/%{pkgdir}/ARC0mod.pm
%{_datadir}/%{pkgdir}/FORKmod.pm
%{_datadir}/%{pkgdir}/Fork.pm
%{_datadir}/%{pkgdir}/SGEmod.pm
%{_datadir}/%{pkgdir}/SGE.pm
%{_datadir}/%{pkgdir}/LL.pm
%{_datadir}/%{pkgdir}/LSF.pm
%{_datadir}/%{pkgdir}/PBS.pm
%{_datadir}/%{pkgdir}/Condor.pm
%{_datadir}/%{pkgdir}/SLURMmod.pm
%{_datadir}/%{pkgdir}/SLURM.pm
%{_datadir}/%{pkgdir}/DGBridge.pm
%{_datadir}/%{pkgdir}/Boinc.pm
%{_datadir}/%{pkgdir}/XmlPrinter.pm
%{_datadir}/%{pkgdir}/InfosysHelper.pm
%{_datadir}/%{pkgdir}/LdifPrinter.pm
%{_datadir}/%{pkgdir}/GLUE2xmlPrinter.pm
%{_datadir}/%{pkgdir}/GLUE2ldifPrinter.pm
%{_datadir}/%{pkgdir}/NGldifPrinter.pm
%{_datadir}/%{pkgdir}/ARC0ClusterInfo.pm
%{_datadir}/%{pkgdir}/ARC1ClusterInfo.pm
%{_datadir}/%{pkgdir}/ConfigCentral.pm
%{_datadir}/%{pkgdir}/GMJobsInfo.pm
%{_datadir}/%{pkgdir}/HostInfo.pm
%{_datadir}/%{pkgdir}/RTEInfo.pm
%{_datadir}/%{pkgdir}/InfoChecker.pm
%{_datadir}/%{pkgdir}/IniParser.pm
%{_datadir}/%{pkgdir}/LRMSInfo.pm
%{_datadir}/%{pkgdir}/Sysinfo.pm
%{_datadir}/%{pkgdir}/LogUtils.pm
%{_datadir}/%{pkgdir}/condor_env.pm
%{_datadir}/%{pkgdir}/cancel_common.sh
%{_datadir}/%{pkgdir}/config_parser.sh
%{_datadir}/%{pkgdir}/configure-*-env.sh
%{_datadir}/%{pkgdir}/submit_common.sh
%{_datadir}/%{pkgdir}/scan_common.sh
%{_datadir}/%{pkgdir}/perferator
%doc %{_mandir}/man1/arc-config-check.1*
%doc %{_mandir}/man1/cache-clean.1*
%doc %{_mandir}/man1/cache-list.1*
%doc %{_mandir}/man1/jura.1*
%doc %{_mandir}/man8/a-rex-backtrace-collect.8*
%doc %{_mandir}/man8/arc-blahp-logger.8*
%doc %{_mandir}/man8/arc-vomsac-check.8*
%if %{with_sqlite}
%doc %{_mandir}/man8/gm-delegations-converter.8*
%endif
%doc %{_mandir}/man8/gm-jobs.8*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-arex
%dir %{_localstatedir}/log/arc
%dir %{_localstatedir}/spool/arc
%dir %{_localstatedir}/spool/arc/ssm
%dir %{_localstatedir}/spool/arc/urs
%{_libexecdir}/%{pkgdir}/ssmsend
%dir %{_datadir}/%{pkgdir}/ssm
%{_datadir}/%{pkgdir}/ssm/__init__.py*
%{_datadir}/%{pkgdir}/ssm/crypto.py*
%{_datadir}/%{pkgdir}/ssm/ssm2.py*
%{_datadir}/%{pkgdir}/ssm/brokers.py*
%{_datadir}/%{pkgdir}/ssm/sender.cfg

%if %{with_acix}
%files acix-core
%dir %{python_sitelib}/acix
%{python_sitelib}/acix/__init__.py*
%{python_sitelib}/acix/core

%files acix-cache
%{python_sitelib}/acix/cacheserver
%if %{use_systemd}
%{_unitdir}/acix-cache.service
%{_datadir}/%{pkgdir}/acix-cache-start
%else
%{_initrddir}/acix-cache
%endif

%files acix-index
%{python_sitelib}/acix/indexserver
%if %{use_systemd}
%{_unitdir}/acix-index.service
%{_datadir}/%{pkgdir}/acix-index-start
%else
%{_initrddir}/acix-index
%endif
%endif

%files devel
%doc docdir/devel/* src/hed/shc/arcpdp/*.xsd
%{_includedir}/%{pkgdir}
%{_libdir}/lib*.so
%{_bindir}/wsdl2hed
%doc %{_mandir}/man1/wsdl2hed.1*
%{_bindir}/arcplugin
%doc %{_mandir}/man1/arcplugin.1*
%{_libdir}/pkgconfig/arcbase.pc

%files plugins-needed
%dir %{_libdir}/%{pkgdir}/test
%{_libdir}/%{pkgdir}/test/libaccTEST.so
%{_libdir}/%{pkgdir}/test/libaccTEST.apd
%{_libdir}/%{pkgdir}/libaccARC1.so
%{_libdir}/%{pkgdir}/libaccBroker.so
%{_libdir}/%{pkgdir}/libaccCREAM.so
%{_libdir}/%{pkgdir}/libaccEMIES.so
%{_libdir}/%{pkgdir}/libaccJobDescriptionParser.so
%{_libdir}/%{pkgdir}/libaccSER.so
%{_libdir}/%{pkgdir}/libaccldap.so
%{_libdir}/%{pkgdir}/libarcshc.so
%{_libdir}/%{pkgdir}/libarcshclegacy.so
%{_libdir}/%{pkgdir}/libdmcfile.so
%{_libdir}/%{pkgdir}/libdmchttp.so
%{_libdir}/%{pkgdir}/libdmcldap.so
%{_libdir}/%{pkgdir}/libdmcsrm.so
%{_libdir}/%{pkgdir}/libdmcrucio.so
%{_libdir}/%{pkgdir}/libdmcacix.so
%{_libdir}/%{pkgdir}/libidentitymap.so
%{_libdir}/%{pkgdir}/libarguspdpclient.so
%{_libdir}/%{pkgdir}/libmcchttp.so
%{_libdir}/%{pkgdir}/libmccmsgvalidator.so
%{_libdir}/%{pkgdir}/libmccsoap.so
%{_libdir}/%{pkgdir}/libmcctcp.so
%{_libdir}/%{pkgdir}/libmcctls.so
%{_libdir}/%{pkgdir}/libaccARC1.apd
%{_libdir}/%{pkgdir}/libaccBroker.apd
%{_libdir}/%{pkgdir}/libaccCREAM.apd
%{_libdir}/%{pkgdir}/libaccEMIES.apd
%{_libdir}/%{pkgdir}/libaccJobDescriptionParser.apd
%{_libdir}/%{pkgdir}/libaccSER.apd
%{_libdir}/%{pkgdir}/libaccldap.apd
%{_libdir}/%{pkgdir}/libarcshc.apd
%{_libdir}/%{pkgdir}/libarcshclegacy.apd
%{_libdir}/%{pkgdir}/libdmcfile.apd
%{_libdir}/%{pkgdir}/libdmchttp.apd
%{_libdir}/%{pkgdir}/libdmcldap.apd
%{_libdir}/%{pkgdir}/libdmcsrm.apd
%{_libdir}/%{pkgdir}/libdmcrucio.apd
%{_libdir}/%{pkgdir}/libdmcacix.apd
%{_libdir}/%{pkgdir}/libidentitymap.apd
%{_libdir}/%{pkgdir}/libarguspdpclient.apd
%{_libdir}/%{pkgdir}/libmcchttp.apd
%{_libdir}/%{pkgdir}/libmccsoap.apd
%{_libdir}/%{pkgdir}/libmcctcp.apd
%{_libdir}/%{pkgdir}/libmccmsgvalidator.apd
%{_libdir}/%{pkgdir}/libmcctls.apd

%files plugins-globus
%{_libdir}/%{pkgdir}/libaccARC0.so
%{_libdir}/%{pkgdir}/libdmcgridftp.so
%{_libdir}/%{pkgdir}/libaccARC0.apd
%{_libdir}/%{pkgdir}/libdmcgridftp.apd
%{_libdir}/libarcglobusutils.so.*
%{_libexecdir}/%{pkgdir}/arc-lcas
%{_libexecdir}/%{pkgdir}/arc-lcmaps

%if %{with_canl}
%files arcproxyalt
%{_bindir}/arcproxyalt
%endif

%if %{with_xrootd}
%files plugins-xrootd
%{_libdir}/%{pkgdir}/libdmcxrootd.so
%{_libdir}/%{pkgdir}/libdmcxrootd.apd
%endif

%if %{with_gfal}
%files plugins-gfal
%{_libdir}/%{pkgdir}/libdmcgfal.so
%{_libdir}/%{pkgdir}/libdmcgfal.apd
%endif

%if %{with_s3}
%files plugins-s3
%{_libdir}/%{pkgdir}/libdmcs3.so
%{_libdir}/%{pkgdir}/libdmcs3.apd
%endif

%if %{with_python}
%files python
%doc docdir/python/*
%{python_sitearch}/_arc.*so
%{python_sitearch}/arc
%{_libdir}/%{pkgdir}/libaccPythonBroker.so
%{_libdir}/%{pkgdir}/libaccPythonBroker.apd
%{_libdir}/%{pkgdir}/libpythonservice.so
%{_libdir}/%{pkgdir}/libpythonservice.apd
%endif

%if %{?fedora}%{!?fedora:0} >= 13
%files python3
%{python3_sitearch}/_arc.*so
%{python3_sitearch}/arc
%endif

%if %{with_java}
%files java
%doc docdir/java/*
%{_libdir}/%{pkgdir}/libjarc.so
%{_jnidir}/arc.jar
%{_libdir}/%{pkgdir}/libjavaservice.so
%{_libdir}/%{pkgdir}/libjavaservice.apd
%endif

%files gridmap-utils
%{_sbindir}/nordugridmap
%config(noreplace) %{_sysconfdir}/cron.d/nordugridmap
%doc src/utils/gridmap/nordugridmap.conf
%doc %{_mandir}/man8/nordugridmap.8*

%files ca-utils

%files misc-utils
%{_bindir}/arcemiestest
%{_bindir}/arcwsrf
%{_bindir}/arcperftest
%if %{with_xmlsec1}
%{_bindir}/saml_assertion_init
%doc %{_mandir}/man1/saml_assertion_init.1*
%endif
%doc %{_mandir}/man1/arcemiestest.1*
%doc %{_mandir}/man1/arcwsrf.1*
%doc %{_mandir}/man1/arcperftest.1*

%changelog
* Thu Jul 06 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.2-1
- 5.3.2 Final Release

* Wed May 31 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.1-1
- 5.3.1 Final Release

* Fri Apr 07 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.0-1
- 5.3.0 Final Release
- Drop patch nordugrid-arc-s3.patch (previously backported)
- EPEL 5 End-Of-Life specfile clean-up

* Fri Mar 24 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.0-0.5.rc1
- Change stomppy Requires to python2-stomppy (Fedora 26+)

* Wed Feb 22 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.2.2-2
- Don't use pylint for EPEL builds (retired)

* Tue Feb 21 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.0-0.4.rc1
- Port to libs3 version 4 (backport from upstream svn)

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.0-0.3.rc1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Feb 07 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.2.2-1
- 5.2.2 Final Release

* Thu Dec 22 2016 Miro Hrončok <mhroncok@redhat.com> - 5.3.0-0.2.rc1
- Rebuild for Python 3.6

* Thu Dec 15 2016 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.2.1-1
- 5.2.1 Final Release

* Sat Nov 19 2016 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.3.0-0.1.rc1
- 5.3.0 Release Candidate 1
- Supports openssl 1.1.0
- Drop canl-c++ support and the nordugrid-arc-arcproxyalt package for
  Fedora >= 26 - canl-c++ not ported to openssl 1.1.0

* Wed Oct 26 2016 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.2.0-1
- 5.2.0 Final Release

* Tue Aug 30 2016 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.1.3-1
- 5.1.3 Final Release
- Convert to systemd (Fedora 25+)

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Jul 06 2016 Mattias Ellert <mattias.ellert@physics.uu.se> - 5.1.2-1
- 5.1.2 Final Release
- Drop patch nordugrid-arc-5.1.1-Fix-to-work-swig-3010.patch (applied upstream)

* Mon Jun 20 2016 Jitka Plesnikova <jplesnik@redhat.com> - 5.1.1-2
- Fix Python code to work with SWIG 3.0.10 (bz #1346169)

* Wed May 25 2016 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.1.1-1
- 5.1.1 Final Release

* Fri May 20 2016 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.1.0-1
- 5.1.0 Final Release

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jan 11 2016 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.5-1
- 5.0.5 Final Release

* Mon Nov 23 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.4-1
- 5.0.4 Final Release
- Drop patch nordugrid-arc-stdpair-c++11.patch
- Add workaround for old py-compile script

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Sep 28 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.3-1
- 5.0.3 Final Release
- Add workaround for too new libsigc++/glibmm in Fedora 23+ (-std=c++11)

* Sat Jul 25 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.2-2
- Adapt to new policycore packaging (Fedora 23+)

* Tue Jun 30 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.2-1
- 5.0.2 Final Release
- Drop patch nordugrid-arc-unbalanced-quotes.patch

* Fri Jun 26 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.1-2
- Fix unbalanced quotes in scan-SLURM-job

* Fri Jun 26 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.1-1
- 5.0.1 Final Release
- Drop patch nordugrid-arc-pytest.patch

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 5.0.0-3
- Rebuilt for GCC 5 C++11 ABI change

* Sun Mar 29 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.0-2
- Fix python build conditionals

* Sat Mar 28 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.0.0-1
- 5.0.0 Final Release
- Drop patches nordugrid-arc-init.patch, -sedfix.patch and -python-print.patch

* Sat Mar 07 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.2.0-5
- Backport removal of python print statements (fixes pylint errors)

* Mon Dec 22 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.2.0-4
- Backport fix for broken sed statement in configure.ac

* Sat Aug 23 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.2.0-3
- Enable xmlsec1 support for EPEL 7

* Thu Aug 21 2014 Kevin Fenzi <kevin@scrye.com> - 4.2.0-2
- Rebuild for rpm bug 1131960

* Mon Aug 18 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.2.0-1
- 4.2.0 Final Release
- Drop patch nordugrid-arc-twisted.patch
- Build for EPEL 7 (without xmlsec)

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Jul 02 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.1.0-4
- Rebuilt for xrootd 4

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 4.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Thu May 01 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.1.0-1
- 4.1.0 Final Release

* Thu Nov 28 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 4.0.0-1
- 4.0.0 Final Release

* Mon Sep 23 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.3-4
- Rebuild for gridsite 2 update

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jul 27 2013 Jóhann B. Guðmundsson <johannbg@fedoraproject.org> - 3.0.3-2
- Add a missing requirement on crontabs to spec file

* Thu Jul 25 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.3-1
- 3.0.3 Final Release
- Drop patch accepted upstream nordugrid-arc-find-syntax.patch
- Add support for _pkgdocdir

* Wed Jul 24 2013 Petr Pisar <ppisar@redhat.com> - 3.0.2-2
- Perl 5.18 rebuild

* Thu Jun 13 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.2-1
- 3.0.2 Final Release

* Wed May 08 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.1-1
- 3.0.1 Final Release

* Tue Apr 16 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.0-2
- Fix python module build logic

* Mon Apr 15 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.0-1
- 3.0.0 Final Release
- Drop obsolete patches nordugrid-arc-swig-209.patch and
  nordugrid-arc-xrootd-private.patch

* Fri Mar 08 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.1-4
- Rebuild for xrootd 3.3

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 23 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.1-2
- Additional selinux contexts
- Fix for python wrappers using swig 2.0.9

* Fri Nov 23 2012 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.1-1
- 2.0.1 Final Release
- Drop patches accepted upstream: nordugrid-arc-unistd.patch,
  nordugrid-arc-pypara.patch, nordugrid-arc-xmlns.patch,
  nordugrid-arc-recursive.patch

* Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 2.0.0-4
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jun 16 2012 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.0-2
- Fix problem with directory hierarchies during job retrieval

* Wed May 23 2012 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.0-1
- 2.0.0 Final Release
- Disable chelonia, hopi, isis and janitor

* Tue Mar 06 2012 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.1.1-1
- 1.1.1 Bugfix Release

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
- Rebuilt for c++ ABI breakage

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Oct 24 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.1.0-2
- Backport fixes for endian independent md5 checksum

* Mon Oct 03 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.1.0-1
- 1.1.0 Final Release
- Drop patches accepted upstream: nordugrid-arc-perl-switch.patch and
  nordugrid-arc-run-full.patch

* Mon Oct 03 2011 Rex Dieter <rdieter@fedoraproject.org> - 1.0.1-3.1
- rebuild (java), rel-eng#4932

* Sat Aug 27 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.1-3
- Move large files away from /var/run in order not to fill up /run partition
- Move arc-lcas and arc-lcmaps to plugins-globus package

* Sun Aug 07 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.1-2
- Remove perl switch statements

* Sun Jul 24 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.1-1.1
- Disable python module on RHEL6 ppc64

* Sat Jul 23 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.1-1
- 1.0.1 Final Release
- Remove Provides/Obsoletes for pre-Fedora packages

* Mon Jul 11 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.0-3
- Fix American English spelling

* Sun Jun 26 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.0-2
- Add missing include <stddef.h> for new gcc

* Mon Apr 18 2011 Mattias Ellert <mattias.ellert@fysast.uu.se> - 1.0.0-1
- Initial release