initdir=/etc/rc.d/init.d
systemddir := /usr/lib/systemd/system
+PYTHON = python3
+
# call with either WITH_SYSTEMD=true or WITH_INIT=true
# otherwise we try to guess some reasonable default
ifeq "$(WITH_INIT)$(WITH_SYSTEMD)" ""
endif
####################
all: forward_api_calls
- python setup.py build
+ $(PYTHON) setup.py build
forward_api_calls: forward_api_calls.c
$(CC) -Wall -Os -o $@ $?
#################### install
install: install-miscell install-startup
- python setup.py install \
+ $(PYTHON) setup.py install \
--install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
--install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
--install-scripts=$(DESTDIR)/$(bindir)
# might be better in setup.py ?
# NOTE: the sliver-initscripts/ and sliver-systemd stuff, being, well, for slivers,
-# need to ship on all nodes regardless of WITH_INIT and WITH_SYSTEMD that
+# need to ship on all nodes regardless of WITH_INIT and WITH_SYSTEMD that
# impacts how nodemanager itself gets started
install-miscell:
install -d -m 755 $(DESTDIR)/var/lib/nodemanager
- install -D -m 644 /dev/null $(DESTDIR)/etc/sysconfig/nodemanager
+ install -D -m 644 /dev/null $(DESTDIR)/etc/sysconfig/nodemanager
install -D -m 444 README $(DESTDIR)/$(datadir)/NodeManager/README
install -D -m 644 logrotate/nodemanager $(DESTDIR)/etc/logrotate.d/nodemanager
mkdir -p $(DESTDIR)/$(datadir)/NodeManager/sliver-initscripts
#################### clean
clean:
- python setup.py clean
+ $(PYTHON) setup.py clean
rm -f forward_api_calls *.pyc build
.PHONY: all install clean
-#################### debian-related
-# This is called from the build with the following variables set
-# (see build/Makefile and target_debian)
-# (.) RPMTARBALL
-# (.) RPMVERSION
-# (.) RPMRELEASE
-# (.) RPMNAME
-DEBVERSION=$(RPMVERSION).$(RPMRELEASE)
-DEBTARBALL=../$(RPMNAME)_$(DEBVERSION).orig.tar.bz2
-DATE=$(shell date -u +"%a, %d %b %Y %T")
-force:
-
-debian: DESTDIR=debian/tmp
-debian: forward_api_calls install debian/changelog debian.source debian.package
-
-debian/changelog: debian/changelog.in
- sed -e "s|@VERSION@|$(DEBVERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog
-
-debian.source: force
- rsync -a $(RPMTARBALL) $(DEBTARBALL)
-
-debian.package:
- debuild --set-envvar PREFIX=/usr -uc -us -b
-
-debian.clean:
- $(MAKE) -f debian/rules clean
- rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build
- find . -name '*.pyc' -delete
-
################################################## devel-oriented
tags:
git ls-files | xargs etags
# and then just run
# $ make sync
-LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
+LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
RSYNC_EXCLUDES := --exclude .git --exclude .svn --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
RSYNC := rsync -e "ssh -i $(NODE).key.rsa" -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
%define _unpackaged_files_terminate_build 0
##############################
-# use initscripts or systemd unit files to start installed services
-%if "%{distro}" == "Fedora" && "%{distrorelease}" >= "18"
+# only systemd unit files to start installed services
%define make_options WITH_SYSTEMD=true
-%define initdir /usr/lib/systemd/system
+%define systemddir /usr/lib/systemd/system
%define build_lxc 1
-%else
-%define make_options WITH_INIT=true
-%define initdir %{_initrddir}
-%define build_vs 1
-%endif
##############################
Summary: PlanetLab Node Manager Library
#BuildArch: noarch
# make sure we can invoke systemctl in post install script
-%if "%{initdir}" != "%{_initrddir}"
Requires: systemd
-%endif
# Uses function decorators
-Requires: python >= 2.7
+Requires: python3
# connecting PLC
-Requires: python-pycurl
+Requires: python3-pycurl
# Signed tickets
Requires: gnupg
# sioc/plnet
##############################
%post
-########## traditional init
-%if "%{initdir}" == "%{_initrddir}"
-##########
-chkconfig --add conf_files
-chkconfig conf_files on
-chkconfig --add nm
-chkconfig nm on
-chkconfig --add fuse-pl
-chkconfig fuse-pl on
-if [ "$PL_BOOTCD" != "1" ] ; then
- service nm restart
- service fuse-pl restart
-fi
-##########
-%else
-########## systemd
systemctl enable nm.service
systemctl enable conf_files.service
# empty
systemctl restart nm.service
# systemctl restart fuse-pl.service
fi
-##########
-%endif
##############################
%preun
# 0 = erase, 1 = upgrade
-########## traditional init
-%if "%{initdir}" == "%{_initrddir}"
-##########
-if [ $1 -eq 0 ] ; then
- chkconfig fuse-pl off
- chkconfig --del fuse-pl
- chkconfig nm off
- chkconfig --del nm
- chkconfig conf_files off
- chkconfig --del conf_files
-fi
-##########
-%else
-########## systemd
if [ $1 -eq 0 ] ; then
# systemctl disable fuse-pl.service
systemctl disable conf_files.service
systemctl disable nm.service
fi
-##########
-%endif
##############################
%clean
%{_datadir}/NodeManager/sliver-initscripts/
%{_datadir}/NodeManager/sliver-systemd/
%{_bindir}/forward_api_calls
-%{initdir}/
+%{systemddir}/
%{_sysconfdir}/logrotate.d/nodemanager
/var/lib/nodemanager/
%config(noreplace) /etc/sysconfig/nodemanager
Group: System Environment/Daemons
# we use libvirt
Requires: libvirt
-Requires: libvirt-python
+Requires: python3-libvirt
# cgroups.py needs this
-Requires: python-inotify
+Requires: python3-inotify
# the common package for nodemanager
Requires: nodemanager-lib = %{version}
# the lxc-specific tools for using slice images
# old name, when all came as a single package with vserver wired in
Obsoletes: NodeManager
-# for nodeupdate
+# for nodeupdate
Provides: nodemanager
# our interface to the vserver patch
* Wed Oct 03 2007 Faiyaz Ahmed <faiyaza@cs.princeton.edu> .
- Switched to SVN.
-* Mon Nov 13 2006 Mark Huang <mlhuang@paris.CS.Princeton.EDU> -
+* Mon Nov 13 2006 Mark Huang <mlhuang@paris.CS.Princeton.EDU> -
- Initial build.