TibiHowTo

How to put publications in cdsware

TibiHowTo/HowToPublishInCdsware

 

How to extract from arch

1. Decide the archive in which to work (the equivalent of CVSROOT) 

$ tla register-archive  infoscience@epfl.ch--micro-2004 sftp://gobry@empc51.epfl.ch/home/arch/repository/infoscience/micro-2004

2. Extract the code (equivalent of cvs checkout) 

$ tla get infoscience@epfl.ch--micro-2004/cdsware--templating--0.3 templating
$ tla get infoscience@epfl.ch--2004/cdsware--epfl--0.4 epfl

re3. Build and ipnstall the extracted code 

$ aclocal
$ autoconf
$ automake -a
$ ./configure --prefix=/home/cdsware/build \
                     --with-webdir=/home/cdsware/build/www \
                     --with-weburl=http://empc38.epfl.ch:81 \
                     --with-dbhost=localhost \
                     --with-dbname=cdsware \
                     --with-dbuser=cdsware \
                     --with-dbpass=lewin \
                     --with-python=/home/cdsware/build/bin/python

4. Start the daemons: 

$ cd /home/cdsware/build/
$ etc/init.d/bibsched start
$ etc/init.d/apache start
$ etc/init.d/mysql start

Warning: sometimes mysql and apache crash. Kill all processes, delete var/run/mysql/*, restart. 

5. Upload some info: 

$ ./bin/bibupload -i /home/gobry/lca.xml
$ ./bin/bibindex -u infoscience@epfl.ch
$ ./bin/bibformat -a -u infoscience@epfl.ch

6. Create caches: 

$ ./bin/webcoll -u infoscience@epfl.ch

7. To update only one collection: 

$ ./bin/webcoll -u infoscience@epfl.ch -c 'Collection name'

 

How to modify the project

Add something in the make files: 

  1. Just one file: 
    • - modify Makefile.am 
         pylib_DATA=<list of already existing files.py> <your_new_file.py>
  2. a directory: 
    • - create the Makefile.am (from the other directories) - in parent directory, modify Makefile.am 
         SUBDIRS = <list of existing directories> <your_new_dir>
      - in configure.ac in the root of the project tree, add the newly created makefile at the end, in the list of Makefiles in the command: 
         AC_CONFIG_FILES([/other/Makefiles \
                          /your/new/directory/Makefile
                         ])
      - execute (in the root of your project): 
        $ automake
        $ autoconf
      - execute (in the "build" directory): 
        $ ./config.status --recheck
        $ ./config.status

 

How to commit

  1. see changes 
    • - added files 
            $ tla tree-lint
      • - add the right files: 
                $ tla add <files>
      - if necessary, delete some files (created files): 
            $ find . -name Makefile.in | xargs rm -f
      - modified files 
            $ tla changes
      - modifications in a file (with diff) 
            $ tla file-diffs
  2. commit files 
    •       $ tla commit -s "Description of changes"

 

Other TLA commands

  1. cvs ignore 
    • $ vi {arch}/=tagging-method

          ...
          precious ^Makefile\.in$
          ...
  2. View sources (multiple branches) of the current code 
    •      $ tla log-versions
  3. Merge one of the source branches (one branch can come from multiple sources). 

WARNING: DO NOT DO THIS WITHOUT THINKING, AS THIS MIGHT CORRUPT ALL YOUR FILES, BY MERGING THEM WITH ANOTHER BRANCH! 

  1. See changes (advanced) 
    •      $ tla changes --diffs
  2. Undo / Redo 
    • One can use undo to get back to the original version (the one currently versioned). This will create a directory (,,undo-x) that you can copy somewhere else and use redo (like a patch) 

    •      $ tla undo
           $ tla redo
      Useful when you got the wrong branch, and you want to commit changes on the other. You can also undo only one file: 
           $ tla file-diff <file>|patch -R -p<depth>

      where <file> is your file, and <depth> is the directory depth at which you are currently at this moment (for example, if your file is modules/mymodule/myfile.ext, you would do: tla file-diff myfile.ext|patch -R -p3) 

  3. Branches TLA - you can find them here: Serveurs

 

How to program with gettext

1. Write your code with _() before each string. 

2. In order to compile the sources, do an import of the gettext function with the name "_" 

3. Extract messages from the sources 

4. copy the .pot (which is a template) for each language 

5. translate the .po files (in external editors) 6. compile the .po files 

7. place the resulting .mo files in a known directory (usually this is /usr/share/locale/<language>, and the file name is <project_name>.mo) 8. remodify your application to load that specific .mo files (see documentation for gettext in the language). 

 

How to test python

1. Pyhton in command line 

$ ipython
$ %pdb
   Starts the debugger online, when error, type "q" as command to exit

2. Use local libraries 

$ export PYTHONPATH=/home/cdsware/src/infoscience/filters/

 

Other stuff

 

How to write a working wsdl

TibiWriteWsdl

How to PEAR

 

[kis@empc19 pear]$ sudo php pearcmd.php list-all
[kis@empc19 pear]$ sudo php pearcmd.php install DB_Pager

DB_Pager c'est le nom de la librairie 

If the library is not in "stable" version, you _might_ get the following error: 

[kis@empc19 pear]$ sudo php pearcmd.php install HTTP_Session
Content-type: text/html
X-Powered-By: PHP/4.3.9

No release with state equal to: 'stable' found for 'HTTP_Session'

To overcome: 

 

[kis@empc19 pear]$ sudo php pearcmd.php download HTTP_Session
[kis@empc19 pear]$ sudo php pearcmd.php install "HTTP_Session-0.4.tgz"

 

How to RPM

  1. Use http://rpmfind.net to find what RPM you need. 

  2. Try to install, get the dependencies errors. 
  3. Repeat step 1 for dependencies until you get it right, then backtrack. You do not necessarily need to use exactly the same distribution as the one the RPM was built for, but it is HIGHLY recommended. 

 

How to build an SSL certificate

 

# create the directory
$ mkdir /home/cdsware/build/conf/ssl
# create the key
$ openssl genrsa -des3 -out /home/cdsware/build/conf/ssl/server.key-pass
# unsign the key
$ openssl rsa -in /home/cdsware/build/conf/ssl/server.key-pass -out /home/cdsware/build/conf/ssl/server.key
# create the certificate request
$ openssl req -new -key /home/cdsware/build/conf/ssl/server.key -out /home/cdsware/build/conf/ssl/server.csr
# create the certificate
$ openssl x509 -req -days 1060 -in /home/cdsware/build/conf/ssl/server.csr -signkey /home/cdsware/build/conf/ssl/server.key -out /home/cdsware/build/conf/ssl/server.crt
# restart apache
...

TibiHowTo (last edited 2011-06-03 06:35:15 by localhost)