# Porting gtranscode (Port created)



## sk8harddiefast (Jan 19, 2012)

I try to port gtranscode. But I cannot fetch the file. This is Make file:


```
# New ports collection makefile for:   Ember
# Date created:        19 January 2012
# Whom:                Ember
#
# $FreeBSD$
#

PORTNAME=   gtranscode
PORTVERSION=    0.3
CATEGORIES= multimedia
MASTER_SITES=   http://fuzzymonkey.net/files/gtranscode-v0.3.tar.gz

MAINTAINER= sk8harddiefast@gmail.com
COMMENT=    Gtk for transcode

MAN1=       ember.1
MANCOMPRESSED=  yes
USE_MAKE=  yes

BUILD_DEPENDS= transcode:${PORTSDIR}/multimedia/transcode

.include <bsd.port.mk>
```

How to fetch it? I get this error


```
sudo make
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
=> gtranscode-0.3.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://fuzzymonkey.net/files/gtranscode-v0.3.tar.gzgtranscode-0.3.tar.gz
fetch: http://fuzzymonkey.net/files/gtranscode-v0.3.tar.gzgtranscode-0.3.tar.gz: Not Found
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/gtranscode-0.3.tar.gz
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/gtranscode-0.3.tar.gz: File unavailable (e.g., file not found, no access)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/home/ember/Desktop/Gtranscode.
```


----------



## jnbek (Jan 19, 2012)

Your MASTER_SITES is set incorrectly try:

```
MASTER_SITES=   http://fuzzymonkey.net/files/
```
instead.


----------



## phoenix (Jan 19, 2012)

> => Attempting to fetch http://fuzzymonkey.net/files/gtranscode-v0.3.tar.gzgtranscode-0.3.tar.gz


Remove the filename from MASTER_SITES.  Only put the website address there.  The ports framework builds the filename using PORTNAME, PORTVERSION, and .tar.gz.

Or you can specify it yourself via the DISTFILE variable.  Since the filename includes *v0.3* instead of just *0.3*, you'll have to do it manually.  Add a DISTFILE line that has the name of the file:

```
DISTFILE=  $PORTNAME-v$PORTVERSION.tar.gz
```
(although the .tar.gz may not be needed).

Also, you'll want to confirm whether or not it uses GNU Make or BSD Make for the build Makefile inside the tarball.  You may need to set *USE_GMAKE* instead of *USE_MAKE*.  It's a rare piece of GTK software that doesn't use GNU Make (aka gmake).

Consider installing ports-mgmt/porttools and ports-mgmt/portlint as those will make it much easier to debug your port.


----------



## SirDice (Jan 19, 2012)

You probably also need to set DISTVERSION because the file to download doesn't fit nicely in ${DISTNAME}-${PORTVERSION}${EXTRACT_SUFX}.


```
DISTVERSION= v0.3
```


----------



## sk8harddiefast (Jan 19, 2012)

Ok. I made it. Now Fetch the file fine 
My Makefile.

```
# New ports collection makefile for:   Ember
# Date created:        19 January 2012
# Whom:                Ember
#
# $FreeBSD$
#

PORTNAME=   gtranscode
PORTVERSION=    0.3
DISTVERSION=    v0.3
CATEGORIES= multimedia
MASTER_SITES=   http://fuzzymonkey.net/files/

MAINTAINER= sk8harddiefast@gmail.com
COMMENT=    Gtk for transcode

MAN1=       gtranscode.1
MANCOMPRESSED=  yes
USE_GMAKE=  yes

DISTFILE=  $PORTNAME-v$PORTVERSION
BUILD_DEPENDS= transcode:${PORTSDIR}/multimedia/transcode

.include <bsd.port.mk>
```

But something goes wrong.

```
ember ~/Desktop/gtranscode $ sudo make install clean
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
=> gtranscode-v0.3.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://fuzzymonkey.net/files/gtranscode-v0.3.tar.gz
gtranscode-v0.3.tar.gz                        100% of   19 kB  728 kBps
===>  Extracting for gtranscode-0.3
=> No checksum file (/usr/home/ember/Desktop/gtranscode/distinfo).
===>  Patching for gtranscode-0.3
===>   gtranscode-0.3 depends on executable: transcode - found
===>   gtranscode-0.3 depends on executable: gmake - found
===>   gtranscode-0.3 depends on executable: gmake - found
===>  Configuring for gtranscode-0.3
===>  Building for gtranscode-0.3
cd: /usr/home/ember/Desktop/gtranscode/work/gtranscode-v0.3: No such file or directory
*** Error code 2

Stop in /usr/home/ember/Desktop/gtranscode.
.
```

Try to go to this path:

```
cd: /usr/home/ember/Desktop/gtranscode/work/gtranscode-v0.3
```
but the path is:

```
cd: /usr/home/ember/Desktop/gtranscode/work/
```


----------



## phoenix (Jan 19, 2012)

There's an entire chapter in the Porter's Handbook on this very subject.


----------



## sk8harddiefast (Jan 20, 2012)

Ok. I am going to read it tomorrow


----------



## SirDice (Jan 20, 2012)

Remove the DISTFILE from your Makefile. It's this name it uses for the work directory. If it's not set it'll automatically figure out to use DISTNAME (which is gtranscode).


----------



## sk8harddiefast (Jan 21, 2012)

Ok. Now the last step. How to
	
	



```
cp gtranscode  /usr/local/bin
```
 via Makefile?


----------



## phoenix (Jan 21, 2012)

If the Makefile that comes with gtranscode doesn't include an *install* target to do that automatically, then you have to do the copy manually in the port Makefile.  See textproc/ripole for an example.  And this chapter in the Porter's Handbook for an explanation of how it works.


----------



## sk8harddiefast (Jan 21, 2012)

I just attached gtranscode as it is now. I will try tomorrow to fix the last step.
For now:
-Fetch trancode
-Fetch gtranscode
-Build & install transcode
-Build gtranscode

Is not doing:
Copy the executable (gtranscode) from work directory to /usr/local/bin

But there is a message about that:

```
===>  Installing for gtranscode-0.3
===>   Generating temporary packing list
echo "There is no 'make install' for this program.  Just copy gtranscode somewhere in your path."
```


----------



## phoenix (Jan 21, 2012)

N phone right now,  will check tarball later.


----------



## phoenix (Jan 22, 2012)

Adding the following above the include line at the bottom should do it:

```
do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
```


----------



## sk8harddiefast (Jan 22, 2012)

Ok. I tried that but trying to install the port I get this error:

```
"Makefile", line 25: Need an operator
make: fatal errors encountered -- cannot continue
```


----------



## phoenix (Jan 22, 2012)

Make sure to use a tab to indent the line after do-install:, and not spaces.

If you install ports-mgmt/portlint, it can check for those kinds of errors like so `# portlint -A /path/to/portdir`

With output that includes the following:

```
WARN: Makefile: [23]: use tab (not space) to make indentation
```


----------



## sk8harddiefast (Jan 22, 2012)

Ok. Port is ok now. I test it and works perfect  I attach it


----------



## glocke (Jan 24, 2012)

Unfortunately I couldn't manage to compile gtranscode. 
First I had no gtk-config installed (which comes with x11-toolkits/gtk12). So I would guess you should add a dependency to that, maybe something like:

```
BUILD_DEPENDS=  gtk-config:${PORTSDIR}/x11-toolkits/gtk12
```
I don't want to install gtk12 I patched the Makefile to use gtk20 (which uses pkg-config instead of gtk-config) like this:

```
--- Makefile~   2003-04-03 22:58:54.000000000 +0200
+++ Makefile    2012-01-24 22:55:45.000000000 +0100
@@ -1,6 +1,6 @@
 CC = gcc
 LDFLAGS = 
-GTKFLAGS = `gtk-config --libs` `gtk-config --cflags`
+GTKFLAGS = `pkg-config --libs gtk+-2.0` `pkg-config --cflags gtk+-2.0`
 
 all: gtranscode
```
I run into following error:

```
root@antec^[0]^23:03^/<1>ports/multimedia/gtranscode# make
===>  Building for gtranscode-0.3
gcc -g  `pkg-config --libs gtk+-2.0` `pkg-config --cflags gtk+-2.0` main.c tcprobe.c interface.c transcode.c -o gtranscode
interface.c: In function 'create_main_window':
interface.c:292: warning: incompatible implicit declaration of built-in function 'strrchr'
interface.c:419: warning: incompatible implicit declaration of built-in function 'strrchr'
interface.c: In function 'MakeTranscodeDialog':
interface.c:787: error: 'GTK_WINDOW_DIALOG' undeclared (first use in this function)
interface.c:787: error: (Each undeclared identifier is reported only once
interface.c:787: error: for each function it appears in.)
interface.c:796: warning: assignment makes pointer from integer without a cast
interface.c: In function 'ShowMessage':
interface.c:857: error: 'GTK_WINDOW_DIALOG' undeclared (first use in this function)
interface.c: In function 'FileselOK':
interface.c:1345: warning: assignment discards qualifiers from pointer target type
interface.c: In function 'FileselOKOutput':
interface.c:1361: warning: assignment discards qualifiers from pointer target type
interface.c: In function 'ProbeVideoFile':
interface.c:1394: warning: passing argument 1 of 'close' makes integer from pointer without a cast
gmake: *** [gtranscode] Error 1
*** Error code 1

Stop in /usr/ports/multimedia/gtranscode.
```
So I guess this wont work with gtk20 

The CHANGELOG states Jul 13, 2003 for the last version. Maybe we are too late for porting this?


----------



## sk8harddiefast (Jan 24, 2012)

Maybe you have right


----------



## da1 (Jan 29, 2012)

I think having a pkg_plist or PLIST_FILES and PLIST_DIRS is also a good practice.


----------

