origin.spec
a0415f10
 #debuginfo not supported with Go
 %global debug_package %{nil}
cf18169a
 # modifying the Go binaries breaks the DWARF debugging
 %global __os_install_post %{_rpmconfigdir}/brp-compress
 
a0415f10
 %global gopath      %{_datadir}/gocode
 %global import_path github.com/openshift/origin
e5048c71
 # The following should only be used for cleanup of sdn-ovs upgrades
 %global kube_plugin_path /usr/libexec/kubernetes/kubelet-plugins/net/exec/redhat~openshift-ovs-subnet
a052ee7d
 
a8ae57fc
 # docker_version is the version of docker requires by packages
0120826c
 %global docker_version 1.9.1
a8ae57fc
 # tuned_version is the version of tuned requires by packages
 %global tuned_version  2.3
 # openvswitch_version is the version of openvswitch requires by packages
 %global openvswitch_version 2.3.1
301fb8dd
 # this is the version we obsolete up to. The packaging changed for Origin
 # 1.0.6 and OSE 3.1 such that 'openshift' package names were no longer used.
 %global package_refector_version 3.0.2.900
633f5c64
 %global golang_version 1.6.2
7a3a9d61
 # %commit and %os_git_vars are intended to be set by tito custom builders provided
ce9187ea
 # in the .tito/lib directory. The values in this spec file will not be kept up to date.
cbb956a2
 %{!?commit:
fe6b7dbe
 %global commit 86b5e46426ba828f49195af21c56f7c6674b48f7
cbb956a2
 }
a0415f10
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
3a71a3fb
 # os_git_vars needed to run hack scripts during rpm builds
 %{!?os_git_vars:
b9ca70f0
 %global os_git_vars OS_GIT_VERSION='' OS_GIT_COMMIT='' OS_GIT_MAJOR='' OS_GIT_MINOR='' OS_GIT_TREE_STATE=''
3a71a3fb
 }
a0415f10
 
32062b92
 %{!?make_redistributable:
3f055a9d
 %if 0%{?fedora} || 0%{?epel}
663a36af
 %global make_redistributable 0
 %else
bebfed0c
 %global make_redistributable 1
663a36af
 %endif
32062b92
 }
bebfed0c
 
089f641d
 # by default build the test binaries for Origin
 %{!?build_tests: %global build_tests 1 }
 
172820c9
 %if "%{dist}" == ".el7aos"
 %global package_name atomic-openshift
 %global product_name Atomic OpenShift
 %else
 %global package_name origin
 %global product_name Origin
 %endif
 
 Name:           %{package_name}
fe6b7dbe
 # Version is not kept up to date and is intended to be set by tito custom
ce9187ea
 # builders provided in the .tito/lib directory of this project
fe6b7dbe
 Version:        0.0.1
 Release:        0%{?dist}
172820c9
 Summary:        Open Source Container Management by Red Hat
a0415f10
 License:        ASL 2.0
 URL:            https://%{import_path}
8721236b
 
 # If go_arches not defined fall through to implicit golang archs
 %if 0%{?go_arches:1}
 ExclusiveArch:  %{go_arches}
 %else
 ExclusiveArch:  x86_64 aarch64 ppc64le
 %endif
 
a0415f10
 Source0:        https://%{import_path}/archive/%{commit}/%{name}-%{version}.tar.gz
 BuildRequires:  systemd
bb3d4ca0
 BuildRequires:  bsdtar
 BuildRequires:  golang >= %{golang_version}
31f94ff8
 BuildRequires:  krb5-devel
aa626e85
 BuildRequires:  rsync
eb247746
 Requires:       %{name}-clients = %{version}-%{release}
6846d546
 Requires:       iptables
301fb8dd
 Obsoletes:      openshift < %{package_refector_version}
a0415f10
 
1663454a
 #
 # The following Bundled Provides entries are populated automatically by the
 # OpenShift Origin tito custom builder found here:
 #   https://github.com/openshift/origin/blob/master/.tito/lib/origin/builder/
cd6c2979
 #
 # These are defined as per:
 # https://fedoraproject.org/wiki/Packaging:Guidelines#Bundling_and_Duplication_of_system_libraries
 #
1663454a
 ### AUTO-BUNDLED-GEN-ENTRY-POINT
cd6c2979
 
a0415f10
 %description
3f055a9d
 Origin is a distribution of Kubernetes optimized for enterprise application
 development and deployment, used by OpenShift 3 and Atomic Enterprise. Origin
 adds developer and operational centric tools on top of Kubernetes to enable
 rapid application development, easy deployment and scaling, and long-term
 lifecycle maintenance for small and large teams and applications.
a0415f10
 
cbb956a2
 %package master
172820c9
 Summary:        %{product_name} Master
387907d4
 Requires:       %{name} = %{version}-%{release}
e43726a9
 Requires(post):   systemd
 Requires(preun):  systemd
dd61b9cb
 Requires(postun): systemd
301fb8dd
 Obsoletes:      openshift-master < %{package_refector_version}
cbb956a2
 
 %description master
 %{summary}
 
089f641d
 %if 0%{build_tests}
0b869f37
 %package tests
 Summary: %{product_name} Test Suite
 Requires:       %{name} = %{version}-%{release}
 
 %description tests
 %{summary}
089f641d
 %endif
0b869f37
 
cbb956a2
 %package node
172820c9
 Summary:        %{product_name} Node
387907d4
 Requires:       %{name} = %{version}-%{release}
ac84acfb
 Requires:       docker >= %{docker_version}
7bfe4a8e
 Requires:       tuned-profiles-%{name}-node = %{version}-%{release}
d3446df2
 Requires:       util-linux
 Requires:       socat
7a896625
 Requires:       nfs-utils
1779eb7e
 Requires:       ethtool
6a549b6c
 Requires:       device-mapper-persistent-data >= 0.6.2
e43726a9
 Requires(post):   systemd
 Requires(preun):  systemd
dd61b9cb
 Requires(postun): systemd
301fb8dd
 Obsoletes:      openshift-node < %{package_refector_version}
cbb956a2
 
 %description node
 %{summary}
 
aba28346
 %package -n tuned-profiles-%{name}-node
172820c9
 Summary:        Tuned profiles for %{product_name} Node hosts
a8ae57fc
 Requires:       tuned >= %{tuned_version}
301fb8dd
 Obsoletes:      tuned-profiles-openshift-node < %{package_refector_version}
cbb956a2
 
aba28346
 %description -n tuned-profiles-%{name}-node
cbb956a2
 %{summary}
 
91b01b55
 %package clients
eb247746
 Summary:        %{product_name} Client binaries for Linux
301fb8dd
 Obsoletes:      openshift-clients < %{package_refector_version}
2d4f067f
 Requires:       git
eb247746
 
 %description clients
 %{summary}
 
bebfed0c
 %if 0%{?make_redistributable}
eb247746
 %package clients-redistributable
e43726a9
 Summary:        %{product_name} Client binaries for Linux, Mac OSX, and Windows
301fb8dd
 Obsoletes:      openshift-clients-redistributable < %{package_refector_version}
91b01b55
 
eb247746
 %description clients-redistributable
5bce31dd
 %{summary}
bebfed0c
 %endif
5bce31dd
 
91b01b55
 %package dockerregistry
172820c9
 Summary:        Docker Registry v2 for %{product_name}
91b01b55
 Requires:       %{name} = %{version}-%{release}
 
 %description dockerregistry
5bce31dd
 %{summary}
cbb956a2
 
7e119f99
 %package pod
172820c9
 Summary:        %{product_name} Pod
7e119f99
 
 %description pod
 %{summary}
 
9280c9ca
 %package sdn-ovs
172820c9
 Summary:          %{product_name} SDN Plugin for Open vSwitch
a8ae57fc
 Requires:         openvswitch >= %{openvswitch_version}
5c329331
 Requires:         %{name}-node = %{version}-%{release}
9280c9ca
 Requires:         bridge-utils
 Requires:         ethtool
3f055a9d
 Requires:         procps-ng
 Requires:         iproute
301fb8dd
 Obsoletes:        openshift-sdn-ovs < %{package_refector_version}
9280c9ca
 
 %description sdn-ovs
 %{summary}
 
0b656151
 %package excluder
 Summary:   Exclude openshift packages from updates
 BuildArch: noarch
 
 %description excluder
 Many times admins do not want openshift updated when doing
 normal system updates.
 
 %{name}-excluder exclude - No openshift packages can be updated
 %{name}-excluder unexclude - Openshift packages can be updated
 
 %package docker-excluder
 Summary:   Exclude docker packages from updates
 BuildArch: noarch
 
 %description docker-excluder
 Certain versions of OpenShift will not work with newer versions
 of docker.  Exclude those versions of docker.
 
 %{name}-docker-excluder exclude - No major docker updates
 %{name}-docker-excluder unexclude - docker packages can be updated
 
a0415f10
 %prep
 %setup -q
 
 %build
7a3a9d61
 # Create Binaries
 %{os_git_vars} hack/build-cross.sh
a0415f10
 
089f641d
 %if 0%{build_tests}
7a3a9d61
 # Create extended.test
 %{os_git_vars} hack/build-go.sh test/extended/extended.test
089f641d
 %endif
7e119f99
 
a0415f10
 %install
 
8721236b
 PLATFORM="$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
a0415f10
 install -d %{buildroot}%{_bindir}
5bce31dd
 
91b01b55
 # Install linux components
a18b810b
 for bin in oc openshift dockerregistry
a0415f10
 do
   echo "+++ INSTALLING ${bin}"
8721236b
   install -p -m 755 _output/local/bin/${PLATFORM}/${bin} %{buildroot}%{_bindir}/${bin}
a0415f10
 done
0b869f37
 install -d %{buildroot}%{_libexecdir}/%{name}
089f641d
 %if 0%{build_tests}
8721236b
 install -p -m 755 _output/local/bin/${PLATFORM}/extended.test %{buildroot}%{_libexecdir}/%{name}/
089f641d
 %endif
aba28346
 
bebfed0c
 %if 0%{?make_redistributable}
172820c9
 # Install client executable for windows and mac
 install -d %{buildroot}%{_datadir}/%{name}/{linux,macosx,windows}
7a3a9d61
 install -p -m 755 _output/local/bin/linux/amd64/oc %{buildroot}%{_datadir}/%{name}/linux/oc
 install -p -m 755 _output/local/bin/darwin/amd64/oc %{buildroot}/%{_datadir}/%{name}/macosx/oc
 install -p -m 755 _output/local/bin/windows/amd64/oc.exe %{buildroot}/%{_datadir}/%{name}/windows/oc.exe
bebfed0c
 %endif
aba28346
 
7a3a9d61
 # Install pod
8721236b
 install -p -m 755 _output/local/bin/${PLATFORM}/pod %{buildroot}%{_bindir}/
a0415f10
 
 install -d -m 0755 %{buildroot}%{_unitdir}
 
 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
 
cd6c2979
 for cmd in \
     atomic-enterprise \
     kube-apiserver \
     kube-controller-manager \
c5df7c8f
     kube-proxy \
     kube-scheduler \
     kubelet \
     kubernetes \
     oadm \
     openshift-deploy \
     openshift-docker-build \
     openshift-f5-router \
a0d977fb
     openshift-recycle \
c5df7c8f
     openshift-router \
     openshift-sti-build \
     origin
cd6c2979
 do
3a71a3fb
     ln -s openshift %{buildroot}%{_bindir}/$cmd
a8ae57fc
 done
242bccfb
 
113fb7b9
 ln -s oc %{buildroot}%{_bindir}/kubectl
eb247746
 
709041a4
 install -d -m 0755 %{buildroot}%{_sysconfdir}/origin/{master,node}
a8ae57fc
 
172820c9
 # different service for origin vs aos
ce9187ea
 install -m 0644 contrib/systemd/%{name}-master.service %{buildroot}%{_unitdir}/%{name}-master.service
 install -m 0644 contrib/systemd/%{name}-node.service %{buildroot}%{_unitdir}/%{name}-node.service
172820c9
 # same sysconfig files for origin vs aos
ce9187ea
 install -m 0644 contrib/systemd/origin-master.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}-master
 install -m 0644 contrib/systemd/origin-node.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}-node
172820c9
 install -d -m 0755 %{buildroot}%{_prefix}/lib/tuned/%{name}-node-{guest,host}
ce9187ea
 install -m 0644 contrib/tuned/origin-node-guest/tuned.conf %{buildroot}%{_prefix}/lib/tuned/%{name}-node-guest/tuned.conf
 install -m 0644 contrib/tuned/origin-node-host/tuned.conf %{buildroot}%{_prefix}/lib/tuned/%{name}-node-host/tuned.conf
9a6c199d
 
3a71a3fb
 # Install man1 man pages
 install -d -m 0755 %{buildroot}%{_mandir}/man1
 install -m 0644 docs/man/man1/* %{buildroot}%{_mandir}/man1/
 
 # Patch and install the manpage for tuned profiles on aos
 install -d -m 0755 %{buildroot}%{_mandir}/man7
9a6c199d
 %if "%{dist}" == ".el7aos"
 %{__sed} -e 's|origin-node|atomic-openshift-node|g' \
  -e 's|ORIGIN_NODE|ATOMIC_OPENSHIFT_NODE|' \
  contrib/tuned/man/tuned-profiles-origin-node.7 > %{buildroot}%{_mandir}/man7/tuned-profiles-%{name}-node.7
 %else
ce9187ea
 install -m 0644 contrib/tuned/man/tuned-profiles-origin-node.7 %{buildroot}%{_mandir}/man7/tuned-profiles-%{name}-node.7
9a6c199d
 %endif
aba28346
 
 mkdir -p %{buildroot}%{_sharedstatedir}/origin
a0415f10
 
c11cb47c
 
9280c9ca
 # Install sdn scripts
cf69a41b
 install -d -m 0755 %{buildroot}%{_sysconfdir}/cni/net.d
 pushd pkg/sdn/plugin/sdn-cni-plugin
8c513443
    install -p -m 0644 80-openshift-sdn.conf %{buildroot}%{_sysconfdir}/cni/net.d
 popd
 pushd pkg/sdn/plugin/bin
    install -p -m 0755 openshift-sdn-ovs %{buildroot}%{_bindir}/openshift-sdn-ovs
172820c9
 popd
cf69a41b
 install -d -m 0755 %{buildroot}/opt/cni/bin
46d5e8ef
 install -p -m 0755 _output/local/bin/${PLATFORM}/sdn-cni-plugin %{buildroot}/opt/cni/bin/openshift-sdn
 install -p -m 0755 _output/local/bin/${PLATFORM}/host-local %{buildroot}/opt/cni/bin
 install -p -m 0755 _output/local/bin/${PLATFORM}/loopback %{buildroot}/opt/cni/bin
cf69a41b
 
172820c9
 install -d -m 0755 %{buildroot}%{_unitdir}/%{name}-node.service.d
ce9187ea
 install -p -m 0644 contrib/systemd/openshift-sdn-ovs.conf %{buildroot}%{_unitdir}/%{name}-node.service.d/openshift-sdn-ovs.conf
cbb956a2
 
ba64fcde
 # Install bash completions
404060df
 install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d/
3a71a3fb
 for bin in oadm oc openshift atomic-enterprise
 do
   echo "+++ INSTALLING BASH COMPLETIONS FOR ${bin} "
   %{buildroot}%{_bindir}/${bin} completion bash > %{buildroot}%{_sysconfdir}/bash_completion.d/${bin}
   chmod 644 %{buildroot}%{_sysconfdir}/bash_completion.d/${bin}
 done
ba64fcde
 
57bbfc39
 # Install origin-accounting
 install -d -m 755 %{buildroot}%{_sysconfdir}/systemd/system.conf.d/
 install -p -m 644 contrib/systemd/origin-accounting.conf %{buildroot}%{_sysconfdir}/systemd/system.conf.d/
 
0b656151
 # Excluder variables
 mkdir -p $RPM_BUILD_ROOT/usr/sbin
 %if 0%{?fedora}
   OS_CONF_FILE="/etc/dnf.conf"
 %else
   OS_CONF_FILE="/etc/yum.conf"
 %endif
 
 # Install openshift-excluder script
 sed "s|@@CONF_FILE-VARIABLE@@|${OS_CONF_FILE}|" contrib/excluder/excluder-template > $RPM_BUILD_ROOT/usr/sbin/%{name}-excluder
c8474424
 sed -i "s|@@PACKAGE_LIST-VARIABLE@@|%{name} %{name}-clients %{name}-clients-redistributable %{name}-dockerregistry %{name}-master %{name}-node %{name}-pod %{name}-recycle %{name}-sdn-ovs %{name}-tests tuned-profiles-%{name}-node %{name}-excluder %{name}-docker-excluder|" $RPM_BUILD_ROOT/usr/sbin/%{name}-excluder
0b656151
 chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-excluder
 
 # Install docker-excluder script
 sed "s|@@CONF_FILE-VARIABLE@@|${OS_CONF_FILE}|" contrib/excluder/excluder-template > $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
c8474424
 sed -i "s|@@PACKAGE_LIST-VARIABLE@@|docker*1.13* docker*1.14* docker*1.15* docker*1.16* docker*1.17* docker*1.18* docker*1.19* docker*1.20*|" $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
0b656151
 chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
 
 
a0415f10
 %files
3f055a9d
 %doc README.md
 %license LICENSE
172820c9
 %{_bindir}/openshift
 %{_bindir}/atomic-enterprise
 %{_bindir}/kube-apiserver
 %{_bindir}/kube-controller-manager
c5df7c8f
 %{_bindir}/kube-proxy
172820c9
 %{_bindir}/kube-scheduler
c5df7c8f
 %{_bindir}/kubelet
 %{_bindir}/kubernetes
 %{_bindir}/oadm
 %{_bindir}/openshift-deploy
 %{_bindir}/openshift-docker-build
 %{_bindir}/openshift-f5-router
a18b810b
 %{_bindir}/openshift-recycle
c5df7c8f
 %{_bindir}/openshift-router
 %{_bindir}/openshift-sti-build
 %{_bindir}/origin
172820c9
 %{_sharedstatedir}/origin
9363e700
 %{_sysconfdir}/bash_completion.d/atomic-enterprise
 %{_sysconfdir}/bash_completion.d/oadm
 %{_sysconfdir}/bash_completion.d/openshift
ad7f598d
 %defattr(-,root,root,0700)
404060df
 %dir %config(noreplace) %{_sysconfdir}/origin
3f055a9d
 %ghost %dir %config(noreplace) %{_sysconfdir}/origin
 %ghost %config(noreplace) %{_sysconfdir}/origin/.config_managed
3a71a3fb
 %{_mandir}/man1/oadm*
 %{_mandir}/man1/openshift*
a0415f10
 
c51f9f57
 %pre
820c7a83
 # If /etc/openshift exists and /etc/origin doesn't, symlink it to /etc/origin
c51f9f57
 if [ -d "%{_sysconfdir}/openshift" ]; then
820c7a83
   if ! [ -d "%{_sysconfdir}/origin"  ]; then
     ln -s %{_sysconfdir}/openshift %{_sysconfdir}/origin
   fi
c51f9f57
 fi
e43726a9
 if [ -d "%{_sharedstatedir}/openshift" ]; then
   if ! [ -d "%{_sharedstatedir}/origin"  ]; then
     ln -s %{_sharedstatedir}/openshift %{_sharedstatedir}/origin
   fi
 fi
 
089f641d
 %if 0%{build_tests}
0b869f37
 %files tests
 %{_libexecdir}/%{name}
 %{_libexecdir}/%{name}/extended.test
089f641d
 %endif
c51f9f57
 
cbb956a2
 %files master
aba28346
 %{_unitdir}/%{name}-master.service
172820c9
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}-master
ad7f598d
 %defattr(-,root,root,0700)
172820c9
 %config(noreplace) %{_sysconfdir}/origin/master
a8ae57fc
 %ghost %config(noreplace) %{_sysconfdir}/origin/admin.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/admin.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/admin.kubeconfig
 %ghost %config(noreplace) %{_sysconfdir}/origin/ca.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/ca.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/ca.serial.txt
 %ghost %config(noreplace) %{_sysconfdir}/origin/etcd.server.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/etcd.server.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/master-config.yaml
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.etcd-client.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.etcd-client.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.kubelet-client.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.kubelet-client.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.server.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/master.server.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-master.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-master.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-master.kubeconfig
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-registry.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-registry.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-registry.kubeconfig
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-router.crt
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-router.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/openshift-router.kubeconfig
 %ghost %config(noreplace) %{_sysconfdir}/origin/policy.json
 %ghost %config(noreplace) %{_sysconfdir}/origin/serviceaccounts.private.key
 %ghost %config(noreplace) %{_sysconfdir}/origin/serviceaccounts.public.key
3f055a9d
 %ghost %config(noreplace) %{_sysconfdir}/origin/.config_managed
a0415f10
 
cbb956a2
 %post master
3f055a9d
 %systemd_post %{name}-master.service
172820c9
 # Create master config and certs if both do not exist
 if [[ ! -e %{_sysconfdir}/origin/master/master-config.yaml &&
      ! -e %{_sysconfdir}/origin/master/ca.crt ]]; then
   %{_bindir}/openshift start master --write-config=%{_sysconfdir}/origin/master
   # Create node configs if they do not already exist
   if ! find %{_sysconfdir}/origin/ -type f -name "node-config.yaml" | grep -E "node-config.yaml"; then
     %{_bindir}/oadm create-node-config --node-dir=%{_sysconfdir}/origin/node/ --node=localhost --hostnames=localhost,127.0.0.1 --node-client-certificate-authority=%{_sysconfdir}/origin/master/ca.crt --signer-cert=%{_sysconfdir}/origin/master/ca.crt --signer-key=%{_sysconfdir}/origin/master/ca.key --signer-serial=%{_sysconfdir}/origin/master/ca.serial.txt --certificate-authority=%{_sysconfdir}/origin/master/ca.crt
   fi
   # Generate a marker file that indicates config and certs were RPM generated
   echo "# Config generated by RPM at "`date -u` > %{_sysconfdir}/origin/.config_managed
709041a4
 fi
a0415f10
 
172820c9
 
cbb956a2
 %preun master
3f055a9d
 %systemd_preun %{name}-master.service
cbb956a2
 
 %postun master
 %systemd_postun
 
 %files node
aba28346
 %{_unitdir}/%{name}-node.service
57bbfc39
 %{_sysconfdir}/systemd/system.conf.d/origin-accounting.conf
aba28346
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}-node
ad7f598d
 %defattr(-,root,root,0700)
404060df
 %config(noreplace) %{_sysconfdir}/origin/node
b54937c0
 %ghost %config(noreplace) %{_sysconfdir}/origin/node/node-config.yaml
3f055a9d
 %ghost %config(noreplace) %{_sysconfdir}/origin/.config_managed
cbb956a2
 
 %post node
3f055a9d
 %systemd_post %{name}-node.service
57bbfc39
 # If accounting is not currently enabled systemd reexec
27dce073
 if [[ `systemctl show docker %{name}-node | grep -q -e CPUAccounting=no -e MemoryAccounting=no; echo $?` == 0 ]]; then
57bbfc39
   systemctl daemon-reexec
 fi
cbb956a2
 
 %preun node
3f055a9d
 %systemd_preun %{name}-node.service
cbb956a2
 
 %postun node
a0415f10
 %systemd_postun
 
9280c9ca
 %files sdn-ovs
3f055a9d
 %dir %{_unitdir}/%{name}-node.service.d/
cf69a41b
 %dir %{_sysconfdir}/cni/net.d
 %dir /opt/cni/bin
f6edd2a0
 %{_bindir}/openshift-sdn-ovs
172820c9
 %{_unitdir}/%{name}-node.service.d/openshift-sdn-ovs.conf
cf69a41b
 %{_sysconfdir}/cni/net.d/80-openshift-sdn.conf
 /opt/cni/bin/*
9280c9ca
 
e5048c71
 %posttrans sdn-ovs
 # This path was installed by older packages but the directory wasn't owned by
 # RPM so we need to clean it up otherwise kubelet throws an error trying to
 # load the directory as a plugin
 if [ -d %{kube_plugin_path} ]; then
   rmdir %{kube_plugin_path}
 fi
 
172820c9
 %files -n tuned-profiles-%{name}-node
3f055a9d
 %license LICENSE
172820c9
 %{_prefix}/lib/tuned/%{name}-node-host
 %{_prefix}/lib/tuned/%{name}-node-guest
 %{_mandir}/man7/tuned-profiles-%{name}-node.7*
cbb956a2
 
172820c9
 %post -n tuned-profiles-%{name}-node
c11cb47c
 recommended=`/usr/sbin/tuned-adm recommend`
 if [[ "${recommended}" =~ guest ]] ; then
172820c9
   /usr/sbin/tuned-adm profile %{name}-node-guest > /dev/null 2>&1
c11cb47c
 else
172820c9
   /usr/sbin/tuned-adm profile %{name}-node-host > /dev/null 2>&1
c11cb47c
 fi
b773ccdf
 
172820c9
 %preun -n tuned-profiles-%{name}-node
b773ccdf
 # reset the tuned profile to the recommended profile
 # $1 = 0 when we're being removed > 0 during upgrades
 if [ "$1" = 0 ]; then
   recommended=`/usr/sbin/tuned-adm recommend`
   /usr/sbin/tuned-adm profile $recommended > /dev/null 2>&1
 fi
cbb956a2
 
91b01b55
 %files clients
3f055a9d
 %license LICENSE
eb247746
 %{_bindir}/oc
 %{_bindir}/kubectl
9363e700
 %{_sysconfdir}/bash_completion.d/oc
3a71a3fb
 %{_mandir}/man1/oc*
eb247746
 
bebfed0c
 %if 0%{?make_redistributable}
eb247746
 %files clients-redistributable
3f055a9d
 %dir %{_datadir}/%{name}/linux/
 %dir %{_datadir}/%{name}/macosx/
 %dir %{_datadir}/%{name}/windows/
432e76ef
 %{_datadir}/%{name}/linux/oc
 %{_datadir}/%{name}/macosx/oc
 %{_datadir}/%{name}/windows/oc.exe
bebfed0c
 %endif
5bce31dd
 
91b01b55
 %files dockerregistry
 %{_bindir}/dockerregistry
cbb956a2
 
7e119f99
 %files pod
 %{_bindir}/pod
 
0b656151
 %files excluder
 /usr/sbin/%{name}-excluder
 
 %post excluder
 if [ "$1" -eq 1 ] ; then
   %{name}-excluder exclude
 fi
 
 %preun excluder
 if [ "$1" -eq 0 ] ; then
   /usr/sbin/%{name}-excluder unexclude
 fi
 
 %files docker-excluder
 /usr/sbin/%{name}-docker-excluder
 
 %post docker-excluder
 # we always want to run this, since the 
 #   package-list may be different with each version
 %{name}-docker-excluder exclude
 
 %preun docker-excluder
 # we always want to clear this out, since the 
 #   package-list may be different with each version
 /usr/sbin/%{name}-docker-excluder unexclude
 
a0415f10
 %changelog
e43726a9
 * Fri Sep 18 2015 Scott Dodson <sdodson@redhat.com> 0.2-9
 - Rename from openshift -> origin
 - Symlink /var/lib/origin to /var/lib/openshift if /var/lib/openshift exists
 
709041a4
 * Wed Aug 12 2015 Steve Milner <smilner@redhat.com> 0.2-8
172820c9
 - Master configs will be generated if none are found when the master is installed.
 - Node configs will be generated if none are found when the master is installed.
 - Additional notice file added if config is generated by the RPM.
709041a4
 - All-In-One services removed.
 
a1a40edf
 * Wed Aug 12 2015 Steve Milner <smilner@redhat.com> 0.2-7
 - Added new ovs script(s) to file lists.
 
cc8a593a
 * Wed Aug  5 2015 Steve Milner <smilner@redhat.com> 0.2-6
 - Using _unitdir instead of _prefix for unit data
 
a8ae57fc
 * Fri Jul 31 2015 Steve Milner <smilner@redhat.com> 0.2-5
 - Configuration location now /etc/origin
 - Default configs created upon installation
 
aba28346
 * Tue Jul 28 2015 Steve Milner <smilner@redhat.com> 0.2-4
 - Added AEP packages
 
cbb956a2
 * Mon Jan 26 2015 Scott Dodson <sdodson@redhat.com> 0.2-3
 - Update to 21fb40637c4e3507cca1fcab6c4d56b06950a149
 - Split packaging of openshift-master and openshift-node
 
a0415f10
 * Mon Jan 19 2015 Scott Dodson <sdodson@redhat.com> 0.2-2
 - new package built with tito
 
 * Fri Jan 09 2015 Adam Miller <admiller@redhat.com> - 0.2-2
 - Add symlink for osc command line tooling (merged in from jhonce@redhat.com)
 
 * Wed Jan 07 2015 Adam Miller <admiller@redhat.com> - 0.2-1
 - Update to latest upstream release
 - Restructured some of the golang deps  build setup for restructuring done
   upstream
 
 * Thu Oct 23 2014 Adam Miller <admiller@redhat.com> - 0-0.0.9.git562842e
 - Add new patches from jhonce for systemd units
 
 * Mon Oct 20 2014 Adam Miller <admiller@redhat.com> - 0-0.0.8.git562842e
 - Update to latest master snapshot
 
 * Wed Oct 15 2014 Adam Miller <admiller@redhat.com> - 0-0.0.7.git7872f0f
 - Update to latest master snapshot
 
 * Fri Oct 03 2014 Adam Miller <admiller@redhat.com> - 0-0.0.6.gite4d4ecf
 - Update to latest Alpha nightly build tag 20141003
 
 * Wed Oct 01 2014 Adam Miller <admiller@redhat.com> - 0-0.0.5.git6d9f1a9
 - Switch to consistent naming, patch by jhonce
 
 * Tue Sep 30 2014 Adam Miller <admiller@redhat.com> - 0-0.0.4.git6d9f1a9
 - Add systemd and sysconfig entries from jhonce
 
 * Tue Sep 23 2014 Adam Miller <admiller@redhat.com> - 0-0.0.3.git6d9f1a9
 - Update to latest upstream.
 
 * Mon Sep 15 2014 Adam Miller <admiller@redhat.com> - 0-0.0.2.git2647df5
 - Update to latest upstream.