# How to build src.txz



## balanga (Apr 17, 2019)

How do I create a src.txz from:-
ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/amd64/8.2-RELEASE/src/


----------



## drhowarddrfine (Apr 17, 2019)

Do you need to? I know it's available as src.txz but I don't have the link right now.

EDIT: src.txz


----------



## ljboiler (Apr 17, 2019)

Pretty sure .txz files are `tar` archives compressed with the xz(1) compression method (the -J option to tar command).


----------



## xtremae (Apr 17, 2019)

In the case of split archives, you can easily extract them using cat + tar. As an example, the following will extract the sources for scrypto: `cat scrypto.* | tar xzvf -`


----------



## ljboiler (Apr 17, 2019)

I would download that entire ftp directory and then use the install.sh script that is included to extract things into a temporary folder (the $DESTDIR environment variable used by the script), which gives you everything extracted into $DESTDIR/usr/src/...
Then do the following to create the new src.txz:

```
cd $DESTDIR
tar cJf /tmp/src.txz usr
```


----------



## balanga (Apr 18, 2019)

ljboiler said:


> I would download that entire ftp directory and then use the install.sh script that is included to extract things into a temporary folder (the $DESTDIR environment variable used by the script), which gives you everything extracted into $DESTDIR/usr/src/...
> Then do the following to create the new src.txz:
> 
> ```
> ...



If I have everything extracted  into $DESTDIR/usr/src/ then I don't really need src.txz. I only wanted src.txz to create $DESTDIR/usr/src/ and didn't know about the install.sh script.


----------



## balanga (Apr 20, 2019)

ljboiler said:


> I would download that entire ftp directory and then use the install.sh script that is included to extract things into a temporary folder (the $DESTDIR environment variable used by the script), which gives you everything extracted into $DESTDIR/usr/src/...
> Then do the following to create the new src.txz:
> 
> ```
> ...




Just wondered if it's possible to retreive the whole subdirectory using fetch()... or get a subdirectory listing and pipe it into fetch..


----------



## ljboiler (Apr 23, 2019)

fetch() is not recursive, doesn't deal with wildcards (but _can_ be given multiple URLs), and doesn't do directory listings as far as I know.


----------



## balanga (May 24, 2019)

Can anyone tell me if this is close (for base - not src)? 


```
mkdir /tmp/base
cd /tmp/base
wget 'ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/amd64/8.2-RELEASE/base/*'
cat base.??  | xz -c -z  > base.txz
```

src is a bit more complicated, but I'll work it out if the above works.


----------

