aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/vobcopy/Makefile
blob: c591a29c7ec88646640d31c20b58e26d6916cd98 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# New ports collection makefile for:    VOB dvd rip
# Date created:             Sun May 12 09:25:37 BRT 2002
# Whom:         Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   vobcopy
PORTVERSION=    1.0.2
CATEGORIES= sysutils
MASTER_SITES=   http://lpn.rnbhq.org/download/

MAINTAINER= josh@tcbug.org
COMMENT=    Decrypts and copies DVD .vob files

LIB_DEPENDS=    dvdread.5:${PORTSDIR}/multimedia/libdvdread

USE_BZIP2=  yes
USE_GETOPT_LONG=    yes
HAS_CONFIGURE=  yes
CONFIGURE_SCRIPT=   configure.sh
CONFIGURE_ARGS= --with-lfs

ALL_TARGET= ${PORTNAME}

MAN1=   vobcopy.1

PLIST_FILES=    bin/vobcopy
PORTDOCS=   COPYING Changelog README Release-Notes TODO \
        alternative_programs.txt

.include <bsd.port.pre.mk>

post-extract:
    @${CHMOD} a+x ${WRKSRC}/${CONFIGURE_SCRIPT}

post-patch:
    @${REINPLACE_CMD} -E -e 's|(fopen\("/etc/)mtab|\1fstab|; \
        s|iso9660|cd9660|' ${WRKSRC}/dvd.c
    @${REINPLACE_CMD} -E -e 's|declare -i i=0||' \
        ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
# -CURRENT after 500041 has getopt_long
# do not use libgnugetopt
.if ${OSVERSION} >= 500041
    @${REINPLACE_CMD} -E \
        -e 's|-lgnugetopt||' \
        ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
.endif
# fix typo
    @${REINPLACE_CMD} -E \
        -e 's|FreeBSD_Version|FreeBSD_version|' \
        ${WRKSRC}/dvd.c
# no such flag under FreeBSD
# fdatasync(2) -> fsync(2)
    @${REINPLACE_CMD} -E \
        -e 's|O_LARGEFILE|0|' \
        -e 's|fdatasync|fsync|g' \
        ${WRKSRC}/vobcopy.c

post-configure:
    @${REINPLACE_CMD} -E -e 's|^CC.+||; s|^PREFIX.+||; \
        s|/usr/local/|${LOCALBASE}/|' \
        ${WRKSRC}/Makefile

do-install:
    @${INSTALL_PROGRAM} ${WRKSRC}/vobcopy ${PREFIX}/bin/vobcopy
    @${INSTALL_MAN} ${WRKSRC}/vobcopy.1${MAN1_SUFX} \
        ${MANPREFIX}/man/man1/vobcopy.1
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
.for file in ${PORTDOCS}
    @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
.endfor
.endif

.include <bsd.port.post.mk>