aboutsummaryrefslogtreecommitdiff
#+title: FSD import utility

=fsd= is a command line utility to download, import and export debian
packages for importing into the [[https://directory.fsf.org][Free Software Directory]].  It is a
Haskell rewrite of [[https://savannah.gnu.org/p/directory][directory]].

* Install
To install, run

#+begin_src sh
cabal install
#+end_src

This will install the binary to =~/.cabal/bin= - make sure it's in
your $PATH.

* Quickstart

To start, create and cd into a directory for the database and
downloaded files, then run

#+begin_src sh
fsd init
#+end_src

to initialise a database, and

#+begin_src sh
fsd get all && fsd import all
#+end_src

to download and import all the index files (sources, packages,
translations).  

Next, download the changelog and copyright files:

#+begin_src sh
fsd get changelog && fsd get copyright
#+end_src

This may take hours, but the downloading is async, so you can start
importing them already, or if you want, you can wait until all wget
processes are finished first.

Import the changelog and copyright files:

#+begin_src sh
fsd import changelog && fsd import copyright
#+end_src

Check approximately what packages are exportable by running

#+begin_src sh
fsd list
#+end_src

And finally, it is time to export to wiki files:

#+begin_src sh
fsd export
#+end_src

it will write all files in =./wiki= directory.

* General usage

To get help, run the command with --help:

#+begin_src sh
fsd --help
#+end_src

and it should output:

#+begin_example
fsd - a tool to import from Debian and export to FSD entries.

Usage: fsd [-d|--database DATABASE] [-m|--dist-dir DISTDIR] 
           [-n|--nworkers NWORKERS] [-e|--export-dir EXPORTDIR] COMMAND

  FSD import script

Available options:
  -d,--database DATABASE   Database store of imported package info.
                           (default: "./directory.db")
  -m,--dist-dir DISTDIR    Root directory to files downloaded from debian.
                           (default: "./distfiles")
  -n,--nworkers NWORKERS   Number of wget workers for downloading changelog and
                           copyright files. (default: 4)
  -e,--export-dir EXPORTDIR
                           Directory to place the exported .wiki files.
                           (default: "./wiki")
  -h,--help                Show this help text

Available commands:
  init                     Initilise database
  get                      Download index and metadata files.
  import                   Import package info from local index and metadata
                           files.
  export                   Export packages to .wiki files.
  list                     List imported packages
#+end_example

* Contact and copyright
- For any issues email <mailto:id@ypei.org>.
- Copyright (C) 2022 Yuchen Pei.
- Licensed under AGPLv3+.