Skip to content
Snippets Groups Projects
Select Git revision
  • c2d1b378a2d840a13b1cab2b58a65d7828c0434e
  • master default protected
  • v2021.2.1
  • v2021.2
  • RC5_v2021.1
  • RC4_v2021.1
  • RC3_v2021.1
  • RC2_v2021.1
  • RC1_v2021.1
  • v2020.1
10 results

SLUB_SIP_Builder

  • Clone with SSH
  • Clone with HTTPS
  • SLUB SIP Builder

    Description

    A CLI tool to create valid BagIt based submission information packages (SIPs) for ingest into the SLUBArchiv, the digital long-term preservation archive of the Saxon State and University Library Dresden (SLUB).

    As a user, you have one of three options to create your SIP: copy, move or replace.
    NOTE: The use of option copy is strongly recommended. The remaining options modify your source directory. Please use these with caution!

    Supported Operating Systems

    • Debian 10
    • Windows 10
      NOTE: check UTF-8 flag at [ENG]Systemadministration/TimeAndRegion/Region/Administration/AreaPattern or [DE]Systemsteuerung/Zeit und Region/Region/Verwaltung/Gebietsschema ändern/, if you want to use such characters as äöüÄÖÜß RECOMMENDED: strawberry perl environment strawberry-perl-5.30.3.1-64bit-portable. It includes cpanm with many preinstalled CPAN modules.

    Requirements

    • Perl version 5.28 or higher
    • cpan or cpanm
    • several CPAN modules such as Archive::BagIt (0.065 or higher)
      • sudo cpan -D Archive::BagIt to check module perl version

    Three ways to install a module

    • with cpan cpan Archive::BagIt
    • with cpanm cpanm Archive::BagIt (NOTE: cpan App::cpanminus must be installed. If errors like IO:AIO are present, use cpanm -i -f Archive::BagIt).
    • from source (Linux)
      1. Download for example Archive-BagIt-0.072.tar.gz from metacpan Archive::BagIt
      2. Extract it with tar zxf Archive-BagIt-0.072.tar.gz and go to project dir with cd in Archive-BagIt-0.072
      3. Run perl Makefile.pl
      4. (d)gmake
      5. (d)gmake test
      6. (d)gmake install
      7. with cpanm Archive::BagIt test for the version. Result will be something like Archive::BagIt is up to date (0.072).

    Archive::BagIt module

    • Sometimes it is offered to update module to a new version use cpan Archive::BagIt. If index not changed to a new one, try cpanm Archive::BagIt::Fast or perl -MCPAN -e 'install Archive::BagIt'

    Perl module deinstallation

    Using cpanm is recommended for an assisted and clean uninstall.

    • install cpanm with cpan App::cpanminus.
    • remove a Perl module with cpanm --uninstall MODULE_NAME

    Documentation

    Recommendation

    • Do not name your directories data
    • mods.xml and rights.xml file names are reserved in directory mets. All same file names will be renamed to 1.xml, 2.xml and so on
    • Use absolute file and directory paths
    • If you try to execute the program for the first time, than use save_option copy

    Explanation

    Usage
    perl bin/slubsipbuilderbagit.pl -help
    Result
    Usage:
        slubsipbuilderbagit.pl [options]
    
        Options: -help brief help message -man full documentation
    
                -save_option=<option>           payload files save as <copy>, <move>, <replace>, the <copy> option should be prefered
                -IE_directory=<IE dir>          existing IE directory (absolute path!)
                -SIP_output_path=<target dir>   where to put the SIP dir (absolute path!)
                -ppn=<ppn>|-noppn=<noppn>       SWB-PPN or any identifier (uses minimalistic MODS)
    
                -SIP_version=<version>          mandatory, needs for identification of SIP format, supported <v2020.1>
                -external_workflow=<workflow>   mandatory, should be uniqe workflow name
                -external_id=<id>               mandatory, should be uniqe ID (i.e. a catalog ID), reuse an ID only when updating existing AIP
                -external_ISIL=<isil>           optional, ISIL number of library
                -external_conservation_flag     optional, if set no other "original" still exists
                -external_value_descr=<text>    mandatory, the reason why to archive
                -rights_version=<version>       mandatory, SLUB law managment specification, supported <1.0>
    
                -rights_xml=<file>              mandatory, path to SLUB rights xml file(absolute path!)
                -add_meta_file=<file>           optional, can be repeated, additional meta files(absolute path!)
                -add_key_value=<"key:value">    optional, can be repeated, additional key value pairs for bag-info.txt
    
    Options:
        -help   Print a brief help message and exits.
    
    Full documentation with examples
    perl -I lib/ bin/slubsipbuilderbagit.pl -man
    Result
    • MUST: Write command in one line.
    EXAMPLES
      Copy    (minimalistic)
        perl bin/slubsipbuilderbagit.pl --save_option=copy
        --IE_directory=/IE/git/SLUB_SIP_Builder/export_dir_kitodo/bagit/test2
        --SIP_output_path=/output_sips --ppn=457035137 --SIP_version=v2020.1
        --external_id=10008 --external_workflow=kitodo --external_ISIL=DE-14
        --external_value_descr="Gesetzlicher Auftrag" --rights_version=1.0
        --rights_xml=/metadata/rights/Fallbeispiel-02.xml
    
      Copy
        perl bin/slubsipbuilderbagit.pl --save_option=copy
        --IE_directory=/IE/git/SLUB_SIP_Builder/export_dir_kitodo/bagit/test2
        --SIP_output_path=/output_sips --ppn=457035137 --SIP_version=v2020.1
        --external_id=10008 --external_workflow=kitodo --external_ISIL=DE-14
        --external_value_descr="Gesetzlicher Auftrag" --rights_version=1.0
        --rights_xml=/metadata/rights/Fallbeispiel-01.xml
        --add_meta_file=/metadata/lido.xml --add_meta_file=/metadata/mods.xml
        --add_key_value="Author:Lew Nikolajewitsch Tolstoi"
        --add_key_value="Titel:Krieg und Frieden" --add_key_value="Genre:Roman"
    
      Replace (minimalistic)
        NOT RECOMMENDED! IF FAILS, "IE" MUST BE MANUAL RESTORED TO THE PREVIOUS
        STATE!!!
    
        perl bin/slubsipbuilderbagit.pl --save_option=replace
        --IE_directory=/IE/SLUB_SIP_Builder/export_dir_kitodo/bagit/test2
        --ppn=457035137 --SIP_version=v2020.1 --external_id=10008
        --external_workflow=kitodo --external_ISIL=DE-14
        --external_value_descr="Gesetzlicher Auftrag" --rights_version=1.0
        --rights_xml=/metadata/rights/Fallbeispiel-01.xml
    
      Move    (minimalistic)
        NOT RECOMMENDED! IF FAILS, "IE" MUST BE MANUAL RESTORED TO THE PREVIOUS
        STATE!!!
    
        perl bin/slubsipbuilderbagit.pl --save_option=move
        --IE_directory=/IE/git/SLUB_SIP_Builder/export_dir_kitodo/bagit/test2
        --SIP_output_path=/output_sips --ppn=457035137 --SIP_version=v2020.1
        --external_id=10008 --external_workflow=kitodo --external_ISIL=DE-14
        --external_value_descr="Gesetzlicher Auftrag" --rights_version=1.0
        --rights_xml=/metadata/rights/Fallbeispiel-03.xml
    Run tests
    • Start script in project directory to run all tests properly.
    • NOTE: while running tests path tmp/bagit will be created.
    perl t/slubsipbuilderbagit.t

    or

    prove t