rgb's Books

Robert G. Brown's General Tools Page

Things on the site itself that may be of interest to students or philosophers of any age or generation include complete online books of poetry, various support materials for the study of physics, and links related to beowulfery. All materials on this site that are authored by Robert G. Brown are Copyright 2004. The details of their Open Public License (modified) can be viewed here. If you use or enjoy anything at all on this site -- free textbooks, stories, programs, or other resources, consider hitting to help spread the word so others can find it as well. Note, Robert G. Brown is generally either rgb or rgbatduke on many external sites crosslinked here.


My Books:

My Books


Home Top Flashcard Program DieHarder Program Benchmaster Program Jove (editor) Program The C Book The Tao of Programming Your Brain: a User's Manual (draft) CVS Mini Howto
C project template PVM project template LaTeX project template HOWTO project template Latex Manual (online) random_pvm demo/template The yum HOWTO (draft) Yum Article Contact About
Amazon Sales Rank Toolset A Theorem Concerning God

Site Links


Home

Home
Lilith
Class
Beowulf
Research
General
Poetry
Prose
Philosophy
Search
Contact
About

Webalyze

Home
Class
Beowulf
Research
General
Poetry
Prose
Philosophy

Misc

Brahma
(webalize)
DBUG
(webalize)
DULUG
Linux@Duke

project_c

by
Robert G. Brown
Duke University Physics Department
Durham, NC 27708-0305
Copyright Robert G. Brown, 2014


Abstract

project_c is a C source project template that permits fully automagical project maintenance to be done with some simple (and not so simple) make targets: make tgz, make rpm, make installweb, make cvs for example. It is worth several hours of work, minimally, in getting a project off the ground, and gets it off on the right foot, with a lot of things you might add "eventually" already there in template form, ready to fill in.

project actually installs from the tarball ONLY -- or if you prefer, the tarball IS the project template ready to use -- but this page and distribution set is more or less automagically created by the make installweb target, so it seems worthwhile to include the rpm's even if they only install a trivial "Hello World!" program.

To use this template, create or change to your source or template directory (I use $HOME/Src/Templates but suit yourself), put the project_c-version.tgz there and unpack it:

 tar xvfz project_c-version.tgz

where of course you should use whatever version of this template that you downloaded. It should verbosely unpack.

Change into the project_c directory. There is a README that gives instructions on how to use to the template (basically, these instructions). Most of the mucky part of the process is encapsulated in a script called "newproject_c". It will install into $HOME/bin (by default, or edit the Makefile to put it whereever you'd like). Read the newproject_c script to see how it works.

To use it is really easy. Once you've unpacked project_c in your templates directory, and if necessary edited newproject_c to point to that templates directory, enter "make installnew". This copies newproject_c into $HOME/bin (or anywhere on your PATH that you like) as noted above. Then simply change into your working/source directory, e.g. $HOME/Src. Enter:

  • newproject_c projectname
  • cd projectname
  • make
  • ./projectname
    (and Hello World example should run).

During the install process, it will ask if you want to directly put the new project under subversion control. If you answer yes it will try to do so into (by default) $HOME/Src/svn-tree/projectname. If you want it anywhere else, or use subversion differently than I do, feel free to hack newproject_c to make it work the way that you like.

If you want to use the make rpm targets, additionally you must:

  • Create a barebones rpm build tree. I put all my sources in ~/Src (as in ~/Src/project) and have my own rpm build tree in ~/Src/rpm_tree. This is basically:
       ./rpm_tree
                 \
                 |-BUILD
                 |-RPMS
                 |-SOURCES
                 |-SPECS
                 |-SRPMS
    
    
    (all initiallyempty and chmod 755). Note that this is in USERSPACE. You don't need to be root to build root-installed rpm's.
  • Create the file ~/.rpmmacros containing: %_topdir /home/rgb/Src/rpm_tree (where you should put in the path to YOUR Src tree, not mine:-).
  • You'll need to edit the RPM_TOPDIR macro in the Makefile to point to this directory. If I were REALLY good I'd make this a part of newproject_c, but it really is reusable and should be outside the project source tree.
  • Edit the projectname.spec file and make the obvious changes. This is not intended to be an RPM build tutorial, but the enclosed spec file should be pretty obvious. If you complete the aforementioned two steps before messing too much with the project template, you SHOULD be able to execute "make rpm" and have it crank out both installation rpm's and src rpms totally automagically. Then all you have to do is keep it working with frequent tests while adding new code and modules (which it is presumed you know how to do). Note that it is a GOOD IDEA to "make tgz" after all final edits (including such details as changing version numbers in the Makefile).
  • Complicated dependencies, fancy distributions, and so forth are all up to you. As I said, this isn't a tutorial in rpm building, just a useful small project template.

Optionally edit the man page template, the README, the abstract, the php file, Remember, the man page is your friend. Also remember to update/modify the "Usage" statement in parsecl.c as you add new command line commands, if any.

If you grab this project_c template and have any fundamental trouble getting it working, let me know and I'll try to help you. My email address is rgb at phy dot duke dot edu.



Contents

Document TypeSize (K)Last Modified
project_c/project_c-2.0.0-1.i386.rpm 7
11/13/13
project_c/project_c-2.0.0-1.src.rpm 73
11/13/13
project_c/project_c.src.rpm 73
11/13/13
project_c/project_c-2.0.0.tgz 70
11/13/13
project_c/project_c.tgz 70
11/13/13
License Info

The documents linked from this page are all provided under a modified Gnu License appropriate for the document type (OPL for text, GPL for software/source). Please read the relevant license(s) before redistributing the document(s) in any form -- an explicit agreement with the author is required for certain kinds of for-profit redistributions. In all cases the license makes the documents generally available for unlimited personal use and non-profit distributions (for example, linking or posting copies on a website, distributing paper copies to a class for free or at cost).

The author cherishes feedback. If you like or dislike the document(s) and would like to say so, wish to redistribute a version in any medium to be sold at a profit, would like to contribute or comment on material, or just want to say hi, feel free to contact the author

Home Top Flashcard Program DieHarder Program Benchmaster Program Jove (editor) Program The C Book The Tao of Programming Your Brain: a User's Manual (draft) CVS Mini Howto
C project template PVM project template LaTeX project template HOWTO project template Latex Manual (online) random_pvm demo/template The yum HOWTO (draft) Yum Article Contact About
Amazon Sales Rank Toolset A Theorem Concerning God

This page is maintained by Robert G. Brown: rgb@phy.duke.edu