##################### GENERAL ##################### 
GARNAME = s6-man-pages
GARVERSION = 20190429
GARCH = noarch
GARELEASE = 1
HOME_URL = https://iztaci.org/software/s6-man-pages
CATEGORIES = doc
MASTER_SITES += https://skarnet.org/software/execline/
MASTER_SITES += https://skarnet.org/software/s6-portable-utils/
MASTER_SITES += https://skarnet.org/software/s6/
MASTER_SITES += https://skarnet.org/software/s6-rc/
MASTER_SITES += https://skarnet.org/software/s6-linux-utils/
MASTER_SITES += https://skarnet.org/software/s6-linux-init/
DISTFILES += $(EXECLINE)
DISTFILES += $(S6_PORTABLE_UTILS)
DISTFILES += $(S6)
DISTFILES += $(S6_RC)
DISTFILES += $(S6_LINUX_UTILS)
DISTFILES += $(S6_LINUX_INIT)
PATCHFILES = 
MAINTAINER = Felipe Sanchez <izto@asic-linux.com.mx>
LICENSE = 

DESCRIPTION = Manual pages for Laurent Bercot's s6 family of utilities.
define BLURB
These manual pages were automatically generated from the HTML documentation
included in the following source code distribution files:

`echo $(DISTFILES) | tr " " "\\n"`
endef

##################### PACKAGING #####################


#IZTACI_PACKAGE_PATH =

# Users and groups the binary package will create
# WHEN INSTALLED ON THE DESTINATION SYSTEM
CREATE_GROUPS = 
CREATE_USERS = 

# This is to be appended to the package's installation script
# Use it to set file owners, permissions, DB initialization, etc.
# Remember any shell variables (Such as $ROOT) have to be escaped
# like this: \$$ROOT

define DOINST_APPEND
endef

# Required dependencies
define SLACK_REQUIRED
endef

# Suggested dependencies
define SLACK_SUGGESTS
man-db
endef

# Package conflicts (lprng vs cups for example)
define SLACK_CONFLICTS
endef



##################### BUILDING #####################


CONFIGURE_SCRIPTS =
BUILD_SCRIPTS =
INSTALL_SCRIPTS = custom

CONFIGURE_ARGS = $(DIRPATHS)
NODIRPATHS = 

# Directories to be created as part of the install process.
# Can be inside the final package or just transient dirs we need
# while building it.
INSTALL_DIRS = $(DESTDIR)/usr/share/man/man1 $(DESTDIR)/usr/share/man/man8

# If some dirs are trying to install into /, list their names
# here, such as: prefix bindir mandir
INSTALL_OVERRIDE_DIRS = 


# Dependencies are of the form categorydir/packagedir
# LIBDEPS are for libraries, and DEPENDS are for everything else
DEPENDS =
LIBDEPS =
DEPENDS =
# Builddeps are installed in the build DESTIMG
BUILDDEPS =

##################### GAR #####################

# This should go before any hand-made rules.
include config.mk
include ../level.mk

##################### CUSTOMIZING #####################


test:
	@echo
	@echo -e "$(WARNCOLOR)No tests are available for this package$(NORMALCOLOR)"
	@echo

install-custom:
	files/generate-s6-manpages.sh $(DESTDIR)/$(mandir) $(WORKDIR) 1 $(MAN1_PROGS) 
	files/generate-s6-manpages.sh $(DESTDIR)/$(mandir) $(WORKDIR) 8 $(MAN8_PROGS)
	sed -i -r "s%$(CURPWD)/$(WORKDIR)%$(docdir)%g;  \
                   s%doc/([^/]+\\.html)%\\1%g;          \
                   s%/$(WORKDIR)/%/$(docdir)/%g;        \
                   s%file:////%file:///%g" $(DESTDIR)/$(mandir)/man{1,8}/*  
	cp -av files/execline.1 $(DESTDIR)/$(mandir)/man1
	cp -av files/s6.8       $(DESTDIR)/$(mandir)/man8
	sed -i -r "s%EXECLINE_VERSION%$(EXECLINE_VERSION)%g" $(DESTDIR)/$(mandir)/man1/execline.1
	sed -i -r "s%S6_VERSION%$(S6_VERSION)%g" $(DESTDIR)/$(mandir)/man8/s6.8
	$(MAKECOOKIE)

post-install:
	$(MAKE) gzip-man
	$(MAKECOOKIE)

