File: Makefile.in

package info (click to toggle)
pnscan 1.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 424 kB
  • sloc: sh: 1,270; ansic: 1,220; makefile: 215
file content (170 lines) | stat: -rw-r--r-- 4,851 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Makefile for pkgs

PREFIX =	@prefix@
PACKAGE =	@PACKAGE_TARNAME@
VERSION =	@PACKAGE_VERSION@
URL = 		@PACKAGE_URL@

# FreeBSD Ports
PORTSDIR =	/usr/ports
PORTSNAME =	sysutils/$(PACKAGE)
PORTSRCDIR =    $(PORTSDIR)/distfiles

# HomeBrew (MacOS) package
BREWDIR =	/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

# SVR (SysV / Solaris classic packages)
PKGPREFIX =     LYS
PKGNAME =	$(PKGPREFIX)$(PACKAGE)
TMPINSTDIR =	/var/tmp/pkg-build-$(PACKAGE)
TMPDESTDIR =	$(TMPINSTDIR)/root
TMPPKGDIR =	$(TMPINSTDIR)/pkg

# RPM
RPMBUILDDIR =	/root/rpmbuild
RPMSPECSDIR =	$(RPMBUILDDIR)/SPECS
RPMSRCDIR =	$(RPMBUILDDIR)/SOURCES
RPMRPMSDIR =	$(RPMBUILDDIR)/RPMS
RPMSRPMSDIR =	$(RPMBUILDDIR)/SRPMS

# OmniOS Extra Repo
OCEXDIR =	../../omnios-extra
OCEXNAME =	ooce/network/$(PACKAGE)
OCEXBUILDDIR =	/tmp/build_$(USER)



INSTALL =	@INSTALL@

@SET_MAKE@


all:
	@echo "Valid targets:"
	@echo "  'port'   (FreeBSD)"
	@echo "  'brew'   (MacOS Homebrew)"
	@echo "  'rpm'    (CentOS/Redhat package)"
	@echo "  'svr'    (Solaris old-style SysV package)"
	@echo "  'omnios' (OmniOS-Extra IPS repo)"
	@exit 1

## FreeBSD Ports package:

port: Makefile.port pkg-descr pkg-plist port-install-dist
	$(INSTALL) -d "$(PORTSDIR)/$(PORTSNAME)"
	cp Makefile.port "$(PORTSDIR)/$(PORTSNAME)/Makefile"
	cp pkg-descr pkg-plist "$(PORTSDIR)/$(PORTSNAME)"
	(cd "$(PORTSDIR)/$(PORTSNAME)" && \
	  make clean && \
	  make makesum && portlint -AC && \
	  make package)
	cp "$(PORTSDIR)/$(PORTSNAME)/work/pkg/$(PACKAGE)-$(VERSION).txz" .

port-test:
	(cd "$(PORTSDIR)/$(PORTSNAME)" && port test "$(PORTSDIR)/$(PORTSNAME)")

port-install-dist:
	(cd .. && make dist && \
	  cp $(PACKAGE)-$(VERSION).tar.gz $(PORTSRCDIR)/ptrrkssn-$(PACKAGE)-v$(VERSION)_GH0.tar.gz)

port-install: port
	(cd "$(PORTSDIR)/$(PORTSNAME)" && make install)


## MacOS HomeBrew package:

brew: brew-install-formulae brew-install-dist

brew-install: brew
	  (brew install $(PACKAGE) || brew upgrade $(PACKAGE) || brew reinstall $(PACKAGE))

brew-install-formulae: $(PACKAGE).rb
	$(INSTALL) -m 0644 $(PACKAGE).rb $(BREWDIR)

# Alternative way to create the formulae
brew-create-formulae:
	brew create https://github.com/ptrrkssn/$(PACKAGE)/archive/v$(VERSION).tar.gz
	brew edit $(PACKAGE)

brew-install-dist:
	(cd .. && $(MAKE) dist && cp "$(PACKAGE)-$(VERSION).tar.gz" "`brew --cache $(PACKAGE)`")


## SVR (Solaris) package:

svr solaris:
	mkdir -p "$(TMPDESTDIR)" && (cd .. && make DESTDIR="$(TMPDESTDIR)" install)
	(echo "i pkginfo"; (cd "$(TMPDESTDIR)$(PREFIX)" && find . -print | pkgproto | awk '{print $$1, $$2, $$3, $$4, "root", "root"}' )) >$(TMPINSTDIR)/prototype
	mkdir -p $(TMPPKGDIR)
	cp pkginfo $(TMPINSTDIR)
	pkgmk -o -a "`uname -p`" -r $(TMPDESTDIR)$(PREFIX) -d $(TMPPKGDIR) -f $(TMPINSTDIR)/prototype
	pkgtrans -s $(TMPPKGDIR) `pwd`/$(PKGNAME).pkg $(PKGNAME)
	rm -fr "$(TMPINSTDIR)"

svr-install: svr
	pkgadd -d ./$(PKGNAME).pkg $(PKGNAME)


## CentOS/RedHat RPM package:

rpm centos redhat: rpm-build

rpm-lint: $(PACKAGE).spec
	rpmlint $(PACKAGE).spec

rpm-install-specs: $(PACKAGE).spec
	$(INSTALL) -d $(RPMSPECSDIR)
	$(INSTALL) -m 0644 $(PACKAGE).spec $(RPMSPECSDIR)

rpm-install-dist:
	(cd .. && make dist && cp $(PACKAGE)-$(VERSION).tar.gz $(RPMSRCDIR))

rpm-build: rpm-install-specs rpm-install-dist
	(cd $(RPMSPECSDIR) && rpmbuild -ba $(PACKAGE).spec) && \
	  cp $(RPMRPMSDIR)/`uname -m`/$(PACKAGE)-$(VERSION)*.rpm . && \
	  cp $(RPMSRPMSDIR)/$(PACKAGE)-$(VERSION)*.src.rpm .

rpm-install-deps:
	yum install rpm-build rpmlint

rpm-install: rpm
	rpm -ivvh $(PACKAGE)-$(VERSION)-1.*.`uname -m`.rpm


## OmniOS (omnios-extra) IPS package:

omnios: omnios-build

omnios-install-config:
	(cd $(OCEXDIR) && git checkout "$(PACKAGE)")
	$(INSTALL) -d "$(OCEXDIR)/build/$(PACKAGE)"
	$(INSTALL) build.sh local.mog "$(OCEXDIR)/build/$(PACKAGE)"
	(cd "$(OCEXDIR)/doc" && if ! fgrep "$(OCEXNAME)" baseline; then \
	  (cat baseline ; echo "extra.omnios $(OCEXNAME)") | sort >baseline.new && mv baseline.new baseline; \
	fi)
	(cd "$(OCEXDIR)/doc" && if ! fgrep "$(OCEXNAME)" packages.md; then \
	  (head -2 packages.md ; \
	   (tail +2 packages.md ; echo "| $(OCEXNAME)		| $(VERSION)	| $(URL) | [ptrrkssn](https://github.com/ptrrkssn)") | \
	    sort) >packages.md.new && mv packages.md.new packages.md; \
	fi)

omnios-install-dist:
	(cd .. && make dist && $(INSTALL) -d "$(OCEXBUILDDIR)/$(PACKAGE)-$(VERSION)" && \
	  $(INSTALL) "$(PACKAGE)-$(VERSION).tar.gz" "$(OCEXBUILDDIR)/$(PACKAGE)-$(VERSION)")

omnios-build: omnios-install-config omnios-install-dist
	(cd $(OCEXDIR)/build/$(PACKAGE) && ./build.sh)

omnios-clean:
	(cd $(OCEXDIR)/build/$(PACKAGE) && rm -f build.log* tmp *~)


# Clean targets
maintainer-clean:	distclean

distclean:		clean
	rm -f Makefile Makefile.port *.pkg pkginfo *.rb *.rpm *.spec pkg-descr build.sh *.txz
	rm -fr "$(TMPINSTDIR)"

clean mostlyclean:
	-rm -f *~ \#*