forked from opensciencegrid/osg-configure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (39 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
PYTHON = python3
VERSION = $(shell $(PYTHON) -c "import sys; sys.path.insert(0, '.'); from osg_configure import version; print(version.__version__)")
NAME := osg-configure
PREFIX := /usr
BINDIR := $(PREFIX)/bin
SBINDIR := $(PREFIX)/sbin
SYSCONFDIR := /etc
DATAROOTDIR := $(PREFIX)/share
PYTHON_SITELIB := $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())")
UPSTREAM_SOFTWARE_DIR = /p/vdt/public/html/upstream/$(NAME)
echo:=@echo
echotbl:=@printf "%-30s %s\n"
help:
$(echo) "Targets:"
$(echo)
$(echotbl) "install" "Install software onto local disk under DESTDIR"
$(echotbl) "install-noconfig" "Install software onto local disk; leave configs in /etc alone"
$(echotbl) "dist" "Create source tarball (don't run on AFS)"
$(echotbl) "upstream" "Put source tarball in VDT upstream software dir (don't run on AFS)"
$(echo)
$(echo) "Variables:"
$(echo)
$(echotbl) "DESTDIR" "Root of where to install [$(DESTDIR)]"
$(echotbl) "UPSTREAM_SOFTWARE_DIR" "Where to upload the source tarball [$(UPSTREAM_SOFTWARE_DIR)]"
install:
$(PYTHON) setup.py install --root=$(DESTDIR)/ --prefix=$(PREFIX)
mkdir -p $(DESTDIR)$(SBINDIR)
mv -f $(DESTDIR)$(BINDIR)/$(NAME) $(DESTDIR)$(SBINDIR)/$(NAME)
install-noconfig:
$(PYTHON) setup.py install_lib -d $(DESTDIR)/$(PYTHON_SITELIB)
$(PYTHON) setup.py install_scripts -d $(DESTDIR)/$(SBINDIR)
dist:
-rm -f MANIFEST
$(PYTHON) setup.py sdist
upstream: dist
mkdir -p $(UPSTREAM_SOFTWARE_DIR)/$(VERSION)
cp -ip dist/$(NAME)-$(VERSION).tar.gz $(UPSTREAM_SOFTWARE_DIR)/$(VERSION)
cd /p/vdt/public/html/upstream && sha1sum $(NAME)/$(VERSION)/$(NAME)-$(VERSION).tar.gz | awk '{print $$2 " sha1sum="$$1}'
.PHONY: help install install-noconfig dist upstream