Some preparation to work with hpk instead of NetBSD pkgtools
This commit is contained in:
parent
5e06435ce2
commit
b24de13af5
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
config.mk
|
config.mk
|
||||||
work
|
work
|
||||||
distfiles/*
|
distfiles/*
|
||||||
packages/*.tgz
|
packages/*.tar.zstd
|
||||||
packages/*.tbz
|
tags
|
||||||
packages/*.txz
|
|
||||||
|
12
mk/ports.mk
12
mk/ports.mk
@ -8,9 +8,9 @@ DESTDIR = $(workdir)/staged
|
|||||||
basedir = $(portdir)/../..
|
basedir = $(portdir)/../..
|
||||||
include $(basedir)/config.mk
|
include $(basedir)/config.mk
|
||||||
|
|
||||||
prefix ?= /usr/pkg
|
prefix ?= /usr
|
||||||
confdir ?= $(prefix)/etc
|
confdir ?= /etc
|
||||||
localstatedir ?= $(prefix)/var
|
localstatedir ?= /var
|
||||||
logdir ?= $(localstatedir)/log
|
logdir ?= $(localstatedir)/log
|
||||||
default_goal ?= all
|
default_goal ?= all
|
||||||
install_cmd ?= $(MAKE) $(makeflags) DESTDIR=$(DESTDIR) -C $(objdir) install
|
install_cmd ?= $(MAKE) $(makeflags) DESTDIR=$(DESTDIR) -C $(objdir) install
|
||||||
@ -42,11 +42,11 @@ man8dir = $(mandir)/man8
|
|||||||
|
|
||||||
distname ?= $(pkg_name)
|
distname ?= $(pkg_name)
|
||||||
pkg_rev ?= 1
|
pkg_rev ?= 1
|
||||||
pkg_ext ?= tgz
|
pkg_ext ?= tar.zstd
|
||||||
pkgfullname ?= $(pkg_name)-$(pkg_version)_hhl$(pkg_rev)
|
pkgfullname ?= $(pkg_name)-$(pkg_version)_$(pkg_rev)
|
||||||
pkgfile ?= $(pkgfullname).$(pkg_ext)
|
pkgfile ?= $(pkgfullname).$(pkg_ext)
|
||||||
pkglocal ?= $(pkgdir)/$(pkgfile)
|
pkglocal ?= $(pkgdir)/$(pkgfile)
|
||||||
pkgdeps = $(workdir)/.stripped $(workdir)/PLIST $(workdir)/BUILD_INFO
|
pkgdeps = $(workdir)/.stripped package.specs
|
||||||
distdir = $(basedir)/distfiles
|
distdir = $(basedir)/distfiles
|
||||||
distfullname ?= $(distname)-$(pkg_version)
|
distfullname ?= $(distname)-$(pkg_version)
|
||||||
distext ?= xz
|
distext ?= xz
|
||||||
|
@ -32,22 +32,13 @@ install: $(workdir)/.installed
|
|||||||
.PHONY: install
|
.PHONY: install
|
||||||
|
|
||||||
package: $(pkglocal)
|
package: $(pkglocal)
|
||||||
|
$(info $(grn)=== $(pkgfullname) created ===$(reset))
|
||||||
|
|
||||||
.PHONY: package
|
.PHONY: package
|
||||||
$(info $(grn)=== $(pkgfullname) created ===$(reset))
|
|
||||||
|
|
||||||
$(pkglocal): $(pkgdeps) | $(pkgdir)
|
$(pkglocal): $(pkgdeps) | $(pkgdir)
|
||||||
$(info $(grn)=== creating package $(pkgfullname) ===$(reset))
|
$(info $(grn)=== creating package $(pkgfullname) ===$(reset))
|
||||||
pkg_create \
|
hpk create -o $(pkgdir) -s package.specs $(DESTDIR)
|
||||||
-c -"$(comment)" \
|
|
||||||
-B $(workdir)/BUILD_INFO \
|
|
||||||
-d $(portdir)/DESCR \
|
|
||||||
-f $(workdir)/PLIST \
|
|
||||||
-I / \
|
|
||||||
-p $(DESTDIR) \
|
|
||||||
-g root \
|
|
||||||
-u root \
|
|
||||||
$@
|
|
||||||
|
|
||||||
$(workdir)/.installed: $(pkglocal)
|
$(workdir)/.installed: $(pkglocal)
|
||||||
$(info $(grn)=== Installing $(distlocal) ===$(reset))
|
$(info $(grn)=== Installing $(distlocal) ===$(reset))
|
||||||
@ -69,47 +60,6 @@ $(workdir)/.staged: $(workdir)/.built
|
|||||||
$(post_install)
|
$(post_install)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
$(workdir)/PLIST: $(workdir)/.staged
|
|
||||||
cd $(DESTDIR) && \
|
|
||||||
find usr -type f -o -type l | sort -u > $@
|
|
||||||
|
|
||||||
$(workdir)/BUILD_INFO: $(workdir)/.staged
|
|
||||||
@echo ABI=$(ABI) > work/build_info
|
|
||||||
@echo BUILD_DATE=$$(date -u "+%y-%m-%d %H:%M:%S") +0000 >> work/build_info
|
|
||||||
@echo BUILD_HOST=$$(uname -a) >> work/build_info
|
|
||||||
@echo CATEGORIES=$$(basename $$(dirname $(portdir))) >> work/build_info
|
|
||||||
@echo CC_VERSION=gcc-$$(gcc --version | head -n 1 | awk '{print $$3}') \
|
|
||||||
>> work/build_info
|
|
||||||
@echo CFLAGS=$(CFLAGS) >> work/build_info
|
|
||||||
@echo GLIBC_VERSION=$$(/lib/libc.so.6 | head -n 1 | awk '{print $9}' | \
|
|
||||||
cut -b 1-4) >> work/build_info
|
|
||||||
@echo HOMEPAGE=$(pkg_homepage) >> work/build_info
|
|
||||||
@echo LDFLAGS=$(LDFLAGS) >> work/build_info
|
|
||||||
@echo LICENSE=$(pkg_license) >> work/build_info
|
|
||||||
@echo LOCALBASE=/usr/pkg >> work/build_info
|
|
||||||
@echo MACHINE_ARCH=$$(uname -m) >> work/build_info
|
|
||||||
@echo MAINTAINER=$(pkg_maintainer) >> work/build_info
|
|
||||||
@echo OBJECT_FMT=ELF >> work/build_info
|
|
||||||
@echo OPSYS=Linux >> work/build_info
|
|
||||||
@echo OS_VERSION=$$(uname -r) >> work/build_info
|
|
||||||
@echo PKGGNUDIR=gnu >> work/build_info
|
|
||||||
@echo PKGINFODIR=info >> work/build_info
|
|
||||||
@echo PKGMANDIR=man >> work/build_info
|
|
||||||
@echo PKGPATH=$$(basename $$(dirname $(portdir)))/$$(basename $(portdir)) \
|
|
||||||
>> work/build_info
|
|
||||||
@echo PKGSYSCONFBASEDIR=/usr/pkg/etc >> work/build_info
|
|
||||||
@echo PKGSYSCONFDIR=/usr/pkg/etc >> work/build_info
|
|
||||||
@echo PKGTOOLS_VERSION=$$(pkg_add -V) >> work/build_info
|
|
||||||
@find $(DESTDIR) -type f | while read f ; \
|
|
||||||
do if [ "$$(file $$f | grep ELF)" != "" ] ; \
|
|
||||||
then ldd $$f ; fi ; \
|
|
||||||
done | awk '{ print $$3 }' | grep -v linux-vdso | sort -u | \
|
|
||||||
while read f ; \
|
|
||||||
do echo REQUIRES=$$f >> work/build_info ; done
|
|
||||||
@for provides in $(pkg_provides) ; \
|
|
||||||
do echo PROVIDES=$${provides} >> work/build_info ; done
|
|
||||||
@mv work/build_info $@
|
|
||||||
|
|
||||||
$(installdirs):
|
$(installdirs):
|
||||||
install -d $@
|
install -d $@
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user