aboutsummaryrefslogtreecommitdiffstats
path: root/misc/usbids/Makefile
blob: e1e7b1bacaa659ce7bd63daea0c412cb30bbf1e7 (plain) (blame)
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
# Created by: Michael Johnson <ahze@FreeBSD.org>
# $FreeBSD$

PORTNAME=   usbids
PORTVERSION=    20181113
CATEGORIES= misc
MASTER_SITES=   LOCAL/sunpoet

MAINTAINER= sunpoet@FreeBSD.org
COMMENT=    Database of all known IDs used in USB devices

LICENSE=    BSD3CLAUSE GPLv2 GPLv3
LICENSE_COMB=   dual

NO_ARCH=    yes
NO_BUILD=   yes
USES=       tar:xz

PORTDATA=   usb.ids

do-install:
    ${MKDIR} ${STAGEDIR}${DATADIR}/
    ${INSTALL_DATA} ${WRKSRC}/usb.ids ${STAGEDIR}${DATADIR}/

# maintainer section:

MS_DIFF=    ${MS_WRKSRC}/${PORTNAME}-${MS_VERSION}.diff
MS_DISTFILES=   usb.ids
MS_MASTER_SITE= http://www.linux-usb.org/
MS_VERSION= `${CAT} ${MS_VERSIONFILE}`
MS_VERSIONFILE= ${MS_WRKSRC}/.version
MS_WRKSRC=  ${WRKSRC}/tmp

maketar: do-clean extract
    @${MKDIR} ${MS_WRKSRC}/
    @${FETCH_CMD} -o ${MS_WRKSRC}/${MS_DISTFILES} ${MS_MASTER_SITE}${MS_DISTFILES}
    @${AWK} '/^# Version/ { gsub(/\./, "", $$3); print $$3 }' ${MS_WRKSRC}/${MS_DISTFILES} > ${MS_VERSIONFILE}
    @${MKDIR} ${MS_WRKSRC}/${PORTNAME}-${PORTVERSION}/ ${MS_WRKSRC}/${PORTNAME}-${MS_VERSION}/
    @${MV} ${MS_WRKSRC}/${MS_DISTFILES} ${MS_WRKSRC}/${PORTNAME}-${MS_VERSION}/
    @${CP} ${WRKSRC}/${MS_DISTFILES} ${MS_WRKSRC}/${PORTNAME}-${PORTVERSION}/${MS_DISTFILES}
    -@cd ${MS_WRKSRC}/ && ${DIFF} -u ${PORTNAME}-${PORTVERSION}/${MS_DISTFILES} ${PORTNAME}-${MS_VERSION}/${MS_DISTFILES} > ${MS_DIFF}
    @if [ -s ${MS_DIFF} ]; then \
        ${CP} -i ${MS_DIFF} ${.CURDIR}/; \
        cd ${MS_WRKSRC}/ && ${TAR} -Jcf ${PORTNAME}-${MS_VERSION}.tar.xz ${PORTNAME}-${MS_VERSION}/; \
        sudo ${INSTALL} -m 644 ${MS_WRKSRC}/${PORTNAME}-${MS_VERSION}.tar.xz ${DISTDIR}/; \
        ${SED} -i '' -e '/^PORTVERSION=/ s|${PORTVERSION}|'${MS_VERSION}'|; /^PORTREVISION=/d' ${.CURDIR}/Makefile; \
        cd ${.CURDIR}/ && ${MAKE_CMD} makesum; \
        ${ECHO_MSG} "*** Update from ${PORTVERSION} to ${MS_VERSION}, diff: ${.CURDIR}/${PORTNAME}-${MS_VERSION}.diff ***"; \
    else \
        ${ECHO_MSG} "*** ${MS_MASTER_SITE}${MS_DISTFILES} is unchanged (${PORTVERSION}) ***"; \
    fi

.include <bsd.port.mk>