This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
geda:gparts_ii [2012/02/20 15:14] 127.0.0.1 external edit |
geda:gparts_ii [2012/10/25 09:03] vzh Removed forgotten </xterm> |
||
---|---|---|---|
Line 25: | Line 25: | ||
==== MySQL ==== | ==== MySQL ==== | ||
- | In order to use MySQL, the packages listed below must be installed. The | + | In order to use MySQL, the packages listed below must be installed. The |
mysql-server package may not be required if configured to use a remote server. | mysql-server package may not be required if configured to use a remote server. | ||
Line 60: | Line 60: | ||
If needed, obtain the source from the source repository. | If needed, obtain the source from the source repository. | ||
- | <xterm>$ git clone git:%%//%%git.gpleda.org/gparts.git | + | $ git clone git://git.geda-project.org/gparts |
- | Initialized empty Git repository in /home/username/Projects/gparts/.git/ | + | Initialized empty Git repository in /home/username/Projects/gparts/.git/ |
- | remote: Counting objects: 930, done. | + | remote: Counting objects: 930, done. |
- | remote: Compressing objects: 100% (712/712), done. | + | remote: Compressing objects: 100% (712/712), done. |
- | remote: Total 930 (delta 735), reused 269 (delta 207) | + | remote: Total 930 (delta 735), reused 269 (delta 207) |
- | Receiving objects: 100% (930/930), 745.34 KiB | 283 KiB/s, done. | + | Receiving objects: 100% (930/930), 745.34 KiB | 283 KiB/s, done. |
- | Resolving deltas: 100% (735/735), done. | + | Resolving deltas: 100% (735/735), done. |
- | $ cd gparts | + | $ cd gparts |
- | $ </xterm> | + | $ |
In the top directory of the source package, execute the following commands. | In the top directory of the source package, execute the following commands. | ||
Support for PostgreSQL is incomplete, so use the configure option. | Support for PostgreSQL is incomplete, so use the configure option. | ||
- | <xterm>$ ./autogen.sh | + | $ ./autogen.sh |
- | $ ./configure --without-postgresql | + | $ ./configure --without-postgresql |
- | $ make</xterm> | + | $ make |
The install requires root privileges. | The install requires root privileges. | ||
- | <xterm>$ sudo make install</xterm> | + | $ sudo make install |
Finally, test the executable. | Finally, test the executable. | ||
- | <xterm>$ gparts</xterm> | + | $ gparts |
To ensure dynamically loaded modules for database support work, select | To ensure dynamically loaded modules for database support work, select | ||
Line 98: | Line 98: | ||
located with dpkg. | located with dpkg. | ||
- | <xterm>$ dpkg -S system-gafrc | + | $ dpkg -S system-gafrc |
- | libgeda-common: /etc/gEDA/system-gafrc | + | libgeda-common: /etc/gEDA/system-gafrc |
- | $ GEDADATARC=/etc/gEDA | + | $ GEDADATARC=/etc/gEDA |
- | $ export GEDADATARC</xterm> | + | $ export GEDADATARC |
Additionally, the parts manager needs to know the location of the symbol | Additionally, the parts manager needs to know the location of the symbol | ||
library and scheme files. | library and scheme files. | ||
- | <xterm>$ dpkg -S gschem.scm | + | $ dpkg -S gschem.scm |
- | geda-gschem: /usr/share/gEDA/scheme/gschem.scm | + | geda-gschem: /usr/share/gEDA/scheme/gschem.scm |
- | $ GEDADATADIR=/usr/share/gEDA | + | $ GEDADATADIR=/usr/share/gEDA |
- | $ export GEDADATADIR</xterm> | + | $ export GEDADATADIR |
===== Database Creation ===== | ===== Database Creation ===== | ||
Line 129: | Line 129: | ||
user accounts may need to be created. | user accounts may need to be created. | ||
- | <xterm>$ mysql -u root -p</xterm> | + | $ mysql -u root -p |
- | <xterm>mysql> create database GParts; | + | mysql> create database GParts; |
- | mysql> use GParts; | + | mysql> use GParts; |
- | mysql> grant all privileges on *.* to 'user'@'localhost' | + | mysql> grant all privileges on *.* to 'user'@'localhost' identified by 'password'; |
- | identified by 'password';</xterm> | + | |
After creating the database, the base tables and part-specific tables must be | After creating the database, the base tables and part-specific tables must be | ||
Line 140: | Line 139: | ||
distributed files. Enter the following commands at the MySQL command line. | distributed files. Enter the following commands at the MySQL command line. | ||
- | <xterm>mysql> source sql/mysql/create-basic.sql | + | mysql> source sql/mysql/create-basic.sql |
- | mysql> source sql/mysql/create-categories.sql | + | mysql> source sql/mysql/create-categories.sql |
- | mysql> source sql/mysql/create-discretes.sql | + | mysql> source sql/mysql/create-discretes.sql |
- | mysql> source sql/mysql/create-passives.sql</xterm> | + | mysql> source sql/mysql/create-passives.sql |
Begin loading the database, starting with package data. The package data must | Begin loading the database, starting with package data. The package data must | ||
be loaded before any parts. | be loaded before any parts. | ||
- | <xterm>mysql> source data/packages.sql</xterm> | + | mysql> source data/packages.sql |
The package includes a tool to parse the symbol libraries and generate an | The package includes a tool to parse the symbol libraries and generate an | ||
Line 156: | Line 155: | ||
below. The symbol data must be loaded before any parts. | below. The symbol data must be loaded before any parts. | ||
- | <xterm>$ tools/symbols.py /usr/share/gEDA >tmp/symbols.sql</xterm> | + | $ tools/symbols.py /usr/share/gEDA >tmp/symbols.sql |
- | <xterm>mysql> source tmp/symbols.sql</xterm> | + | mysql> source tmp/symbols.sql |
The package includes a script to generate some sample part data. Similar to | The package includes a script to generate some sample part data. Similar to | ||
Line 164: | Line 163: | ||
the MySQL prompt. | the MySQL prompt. | ||
- | <xterm>$ data/parts-bourns.py >tmp/parts-bourns.sql</xterm> | + | $ data/parts-bourns.py >tmp/parts-bourns.sql |
- | <xterm>mysql> source tmp/parts-bourns.sql</xterm> | + | mysql> source tmp/parts-bourns.sql |
Line 184: | Line 183: | ||
gparts/sql/sqlite. | gparts/sql/sqlite. | ||
- | <xterm>$ sqlite3 sample.db | + | $ sqlite3 sample.db |
- | SQLite version 3.6.22 | + | SQLite version 3.6.22 |
- | Enter ".help" for instructions | + | Enter ".help" for instructions |
- | Enter SQL statements terminated with a ";" | + | Enter SQL statements terminated with a ";" |
- | sqlite></xterm> | + | sqlite> |
After creating the database, read base and part specific tables into the | After creating the database, read base and part specific tables into the | ||
database. | database. | ||
- | <xterm>sqlite> .read create-basic.sql | + | sqlite> .read create-basic.sql |
- | sqlite> .read create-categories.sql | + | sqlite> .read create-categories.sql |
- | sqlite> .read create-discretes.sql | + | sqlite> .read create-discretes.sql |
- | sqlite> .read create-passives.sql</xterm> | + | sqlite> .read create-passives.sql |
Read sample symbols into the database. | Read sample symbols into the database. | ||
- | <xterm>sqlite> .read symbols.sql</xterm> | + | sqlite> .read symbols.sql |
Exit the command line interface. | Exit the command line interface. | ||
- | <xterm>sqlite> .exit</xterm> | + | sqlite> .exit |
Read sample companies and packages into the database. The source distribution stores packages in XML. The distribution contains an XSLT stylesheet to convert XML into SQL for importing into SQLite. Use the following command line to perform this operation. | Read sample companies and packages into the database. The source distribution stores packages in XML. The distribution contains an XSLT stylesheet to convert XML into SQL for importing into SQLite. Use the following command line to perform this operation. | ||
- | <xterm>$ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db | + | $ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db |
- | $ xsltproc convert.xml ../../data/packages.xml | sqlite3 sample.db</xterm> | + | $ xsltproc convert.xml ../../data/packages.xml | sqlite3 sample.db |
Read sample parts into the database. | Read sample parts into the database. | ||
- | <xterm>$ ../../data/parts-bourns.py >../../tmp/parts-bourns.xml | + | $ ../../data/parts-bourns.py >../../tmp/parts-bourns.xml |
- | $ xsltproc convert.xml ../../tmp/parts-bourns.xml | sqlite3 sample.db</xterm> | + | $ xsltproc convert.xml ../../tmp/parts-bourns.xml | sqlite3 sample.db |
For other sample parts, the data is not generated with a script. | For other sample parts, the data is not generated with a script. | ||
- | <xterm>$ xsltproc convert.xml ../../tmp/rhom-discretes.xml | sqlite3 sample.db</xterm> | + | $ xsltproc convert.xml ../../tmp/rhom-discretes.xml | sqlite3 sample.db |