Help with a Paint package I am writing please!!

Hi, I am writing a program to work as a paint application. I have all the necessary buttons. One of my buttons needs to be able to add a small image to the painting frame by clicking the mouse onto the screen...for example, to display a picture of a house, I click the house button which then puts my house picture onto the scribble panel wherever I click the mouse. My problem is that I am new to java and I am stuck on how I can do this. I have put all the code on here which I have. If any one knows the code which I can add to make this work I would very much appreciate it as it is driving me insane!
Many thanks....
CODE "DrawingTools.java".............................
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.geom.*;
public class DrawingTools {
public static void main (String [] args) {
     Toolkit tk = Toolkit.getDefaultToolkit(); // get system dependent information
Dimension dim = tk.getScreenSize(); // encapsulate width and height of system
JFrame f = new DrawingToolFrame();
f.setSize(800, 550);
f.setTitle("Drawing Tool v1.10");
f.setIconImage(tk.getImage("Paint.gif"));
f.setVisible(true);
f.setResizable(false);
class DrawingToolFrame extends JFrame implements ActionListener {
private JCheckBox checkNormal, checkBold, checkDotted, checkSpray;
// private JRadioButton orBlack, orBlue, orRed, orYellow, orNormal, orBold, orDotted, orSpray;
private JButton boldButton, dottedButton, sprayButton;
private JButton blackButton, blueButton, yellowButton, redButton, greenButton, houseButton, tvButton, starButton;
private ScribblePanel scribblePanel;
private JButton scribbleButton, undoButton, newButton, quitButton;
private JMenuItem newItem, quitItem, undoItem, houseItem, tvItem, starItem,/* normalItem,*/ boldItem, dottedItem, sprayItem, blackItem, blueItem, redItem, yellowItem, greenItem;
public DrawingToolFrame() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
Container contentPane = getContentPane();
JMenuBar menuBar = new JMenuBar();
     setJMenuBar(menuBar);
     JMenu fileMenu = new JMenu("File");
     newItem = new JMenuItem("New");
     newItem.setMnemonic(KeyEvent.VK_N); //add Alt-N to New short-cut
     newItem.addActionListener(this);
     fileMenu.add(newItem);
     quitItem = new JMenuItem("Quit");
     quitItem.setMnemonic(KeyEvent.VK_Q); //add Alt-Q to Quit short-cut
     quitItem.addActionListener(this);
     fileMenu.add(quitItem);
     menuBar.add(fileMenu);
     JMenu editMenu = new JMenu("Edit");
     undoItem = new JMenuItem("Undo");
     undoItem.addActionListener(this);
     editMenu.add(undoItem);
     menuBar.add(editMenu);
     JMenu shapeMenu = new JMenu("Shape");
     houseItem = new JMenuItem("House");
     houseItem.addActionListener(this);
     shapeMenu.add(houseItem);
     tvItem = new JMenuItem("Television");
     tvItem.addActionListener(this);
     shapeMenu.add(tvItem);
     starItem = new JMenuItem("Star");
     starItem.addActionListener(this);
     shapeMenu.add(starItem);
     menuBar.add(shapeMenu);
JMenu optionMenu = new JMenu("Option");
JMenu lineMenu = new JMenu("Line");
     optionMenu.add(lineMenu);
          //normalItem = new JMenuItem("Normal");
          //normalItem.addActionListener(this);
          //lineMenu.add(normalItem);
          boldItem = new JMenuItem("Bold");
          boldItem.addActionListener(this);
          lineMenu.add(boldItem);
          dottedItem = new JMenuItem("Dotted");
          dottedItem.addActionListener(this);
     lineMenu.add(dottedItem);
     sprayItem = new JMenuItem("Spray");
     sprayItem.addActionListener(this);
     lineMenu.add(sprayItem);
     JMenu colourMenu = new JMenu("Colour");
     optionMenu.add(colourMenu);
          blackItem = new JMenuItem("Black");
          blackItem.addActionListener(this);
          colourMenu.add(blackItem);
          blueItem = new JMenuItem("Blue");
          blueItem.addActionListener(this);
          colourMenu.add(blueItem);
          redItem = new JMenuItem("Red");
          redItem.addActionListener(this);
     colourMenu.add(redItem);
     yellowItem = new JMenuItem("Yellow");
     yellowItem.addActionListener(this);
     colourMenu.add(yellowItem);
     greenItem = new JMenuItem("Green");
               greenItem.addActionListener(this);
     colourMenu.add(greenItem);
     menuBar.add(optionMenu);
JPanel p = new JPanel();
ImageIcon scribbleIcon = new ImageIcon("Scribble.gif");
scribbleButton = new JButton("Scribble", scribbleIcon);
scribbleButton.setMnemonic(KeyEvent.VK_S); //add Alt-S to Undo short-cut
scribbleButton.setToolTipText("Click this button and you can draw free hand lines.");
p.add(scribbleButton);
//scribbleButton = addJButton("Scribble", p);
p.add(Box.createHorizontalStrut(20));
ImageIcon undoIcon = new ImageIcon("Undo.gif");
undoButton = new JButton("Undo", undoIcon);
undoButton.setMnemonic(KeyEvent.VK_U); //add Alt-U to Undo short-cut
undoButton.setToolTipText("Undo the last step");
p.add(undoButton);
//undoButton.addActionListener(this);
p.add(Box.createHorizontalStrut(20));
ImageIcon newIcon = new ImageIcon("New.gif");
newButton = new JButton("New", newIcon);
newButton.setMnemonic(KeyEvent.VK_N); //add Alt-N to New short-cut
newButton.setToolTipText("Make a new Drawing");
p.add(newButton);
p.add(Box.createHorizontalStrut(20));
ImageIcon quitIcon = new ImageIcon("Door.gif"); //add icon to button
quitButton = new JButton("Quit", quitIcon);
quitButton.setMnemonic(KeyEvent.VK_Q); //add Alt-Q to exit short-cut
quitButton.setToolTipText("Click to Exit");
p.add(quitButton);
undoButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
scribblePanel.undo();}});
scribbleButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
scribblePanel.repaint();}});
newButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
scribblePanel.repaint();}});
quitButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
System.exit(0);}});
contentPane.add(p, "South");
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
p.add(Box.createVerticalStrut(10));
ImageIcon boldIcon = new ImageIcon("Bold.gif"); //add icon to button
boldButton = new JButton("Bold", boldIcon);
p.add(boldButton);
p.add(Box.createVerticalStrut(10));
ImageIcon dottedIcon = new ImageIcon("Dotted.gif"); //add icon to button
dottedButton = new JButton("Dotted", dottedIcon);
p.add(dottedButton);
p.add(Box.createVerticalStrut(10));
ImageIcon sprayIcon = new ImageIcon("Spray.gif"); //add icon to button
sprayButton = new JButton("Spray", sprayIcon);
p.add(sprayButton);
/*     ButtonGroup groupA = new ButtonGroup();
     p.add(Box.createVerticalStrut(20));
     orNormal = addJRadioButton("Normal", true, groupA, p);
     p.add(Box.createVerticalStrut(20));
     orBold = addJRadioButton("Bold", false, groupA, p);
     p.add(Box.createVerticalStrut(20));
     orDotted = addJRadioButton("Dotted", false, groupA, p);
     p.add(Box.createVerticalStrut(20));
     orSpray = addJRadioButton("Spray", false, groupA, p);*/
contentPane.add(p, "East");
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
p.add(Box.createVerticalStrut(10));
ImageIcon dIcon = new ImageIcon("Black.gif"); //add icon to button
blackButton = new JButton("Black", dIcon);
p.add(blackButton);
p.add(Box.createVerticalStrut(10));
ImageIcon eIcon = new ImageIcon("Blue.gif"); //add icon to button
blueButton = new JButton("Blue", eIcon);
p.add(blueButton);
p.add(Box.createVerticalStrut(10));
ImageIcon fIcon = new ImageIcon("Red.gif"); //add icon to button
redButton = new JButton("Red", fIcon);
p.add(redButton);
p.add(Box.createVerticalStrut(10));
ImageIcon gIcon = new ImageIcon("Yellow.gif"); //add icon to button
yellowButton = new JButton("Yellow", gIcon);
p.add(yellowButton);
p.add(Box.createVerticalStrut(10));
ImageIcon hIcon = new ImageIcon("Green.gif"); //add icon to button
greenButton = new JButton("Green", hIcon);
p.add(greenButton);
p.add(Box.createVerticalStrut(30));
ImageIcon houseIcon = new ImageIcon("house.gif");
houseButton = new JButton("House", houseIcon);
houseButton.setToolTipText("Click to add a house in the picture!");
p.add(houseButton);
//houseButton = addJButton("House", p);
p.add(Box.createVerticalStrut(10));
ImageIcon tvIcon = new ImageIcon("tv.gif");
tvButton = new JButton("Television", tvIcon);
tvButton.setToolTipText("Click to add a Television in the picture!");
p.add(tvButton);
//tvButton = addJButton("Television", p);
p.add(Box.createVerticalStrut(10));
ImageIcon starIcon = new ImageIcon("star.gif");
starButton = new JButton("Star", starIcon);
starButton.setToolTipText("Click to add stars in the picture!");
p.add(starButton);
//starButton = addJButton("Star", p);
contentPane.add(p, "West");
scribblePanel = new ScribblePanel();
contentPane.add(scribblePanel, "Center");
private JButton addJButton(String text, Container container) {
JButton button = new JButton(text);
container.add(button);
return button;
private JRadioButton addJRadioButton(String text, boolean on, ButtonGroup group, Container container) {
JRadioButton button = new JRadioButton(text, on);
group.add(button);
container.add(button);
return button;
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source instanceof JMenuItem) {
String arg = e.getActionCommand();
if (arg.equals("Undo"))
scribblePanel.undo();
else if (arg.equals("New"))
scribblePanel.repaint();
else if (arg.equals("Quit"))
System.exit(0);
}

Hi,
try to implement the Interface MouseListener (or the corresponding MouseAdapter):
eg:
class DrawingToolFrame extends JFrame implements ActionListener, MouseListener{
//add a MouseListener to the component withing you would like to fetch the mouse-coordinates
yourPanel.addMouseListener(this);
//implement the five methods of the MouseListener
public void mouseClicked(MouseEvent�e){}
public void mouseEntered(MouseEvent�e){}
public void mouseExited(MouseEvent�e) {}
public void mousePressed(MouseEvent�e){}
public void mouseReleased(MouseEvent�e){
e.getX(); //Coordinates of the mouse after releasing the button
e.getY();

Similar Messages

  • Need help with premiere pro cs6 having performance issues please help

    need help with premiere pro cs6 having performance issues please help

    Welcome to the forum.
    First thing that I would do would be to look at this Adobe KB Article to see if it helps.
    Next, I would try the tips in this ARTICLE.
    If that does not help, a Repair Install would definitely be in order.
    Good luck,
    Hunt

  • Help with a Paint Program if you'd be kind

    Hi, I am making a simple paint package...like simple Paint in Windows, I am trying to change the colour of the scribble line, so I have a button to click and then it scribbles on my panel in a different colour....i.e changing from Black to Red.
    I'm new to all this, so I'm not getting that far, but I know a little...
    I have the following code......
    (this is in a seperate panel.java file
    public void lineTo2(int x, int y) {
    Graphics2D g2 = currImage.createGraphics();
    line.setLine(lastX, lastY, x, y);
    g2.setPaint(Color.black);
    g2.setStroke(stroke);
    g2.draw(line);
    moveTo(x,y);
    g2.dispose();
    repaint();
    and then in my other .java file I have the following to use the buttons.......
    public void actionPerformed(ActionEvent event) {
    Object source = event.getSource();
    if (source == undoButton)
    myDrawing.undo();
    else if (source == exitButton)
    System.exit(0);
    else if (source == exitItem)
    System.exit(0);
    else if (source == redButton)
    repaint();
    ....so I don't quite know what method to use with the Red Button so that it only changes to red when I click that button?
    Any help would be great, and I'm sorry if my terminology is not that of an experienced programmer!
    Many Thanks
    Jon(UK)

    Have a member variable containing the current drawing colour. You then just need to change that when the button is pressed:
    private Color paintColor = Color.black; // Initial colour
    public void lineTo2(...)
      g2.setPaint(paintColor);
    public void actionPerformed(...)
      else if(source == redButton)
        paintColor = Color.red;
      else if(source == blackButton)
        paintColor = Color.black;
    }Hope this helps.

  • Help with queries about boot camp and partition, please.

    Hi, I am hoping to partition my HDD. I have done this before, when I first got my macbook but got rid of it, and now I can't fully remember the do's and don'ts' of boot camp. I just need a few questions answered before I take any action.
    1. I have a 120GB HDD with about 15GB free space. If I partition the drive will I lose any data on my existing HDD?
    2. What is the minimal amount of space I can partition the drive and install Windows?
    (I have a copy of Windows XP SP2, and really only need to install it for the use of one program that isn't available on the Apple operating systems.)
    3. I tried using Parallels in which Windows took up about 6GB, will it be about the same again? I uninstalled it because I found it to lag a bit.
    If you can help with any of these queries I would really appreciate it, thanks!

    Maybe you should first get a larger drive; you don't have much more than the minimum 10% free space that Mac OS needs.
    Retry with Sun's VirtualBox. Maybe you just need more memory.
    Lose data? Step #1: backup.
    You may need to backup and erase your hard drive and then restore.
    I'd invest in 300GB drive though.

  • I need help  with compiling different packages

    I've just downloaded j2sdk1.4.0_03 and when i use
    import TerminalIO.KeyboardReader;
    it says : package TerminalIO does not exist;
    and it also has a problem with KeyboardReader.
    Please help me!

    The TerminalIO is not part of standard java classes. Some one must have given that to you, or needs to give it to you. It might be in a jar file. Without knowing what/where the TerminalIO package is, it is difficult to help you.
    If the package is in a jar, then you need to include the jar in your Classpath when you compile. If it is not in a jar, then the directory that contains the TerminalIO directory needs to be in the Classpath.
    http://java.sun.com/docs/books/tutorial/java/interpack/packages.html

  • Help with Java.Sql package download

    I am compiling some java files with the following :
    import java.sql.*
    and getting errors. I realize I need the java.sql package. Can anyone help me by pointing out where I can download the package?
    Thanks.
    Murthy Gandikota

    This package comes with the JDK. what are your specific problems.

  • Help with Live Paint - filling in part of an image

    I have imported a dfw image into illustrator. It's a black and white image of an object similar to the one below:
    I want to paint the areas around the perimeter of the image black so that it looks like it has a large black outline (the areas that contain the X's). I've been able to do it on a few but some of the images, when I open them, the live paint selects only inner areas that I don't want painted. I can't figure out how to change the paths to the ones I want.
    I import the image, select all, Object>Live Paiint>Make. Then I set the fill to black. In this example, there are 3 stripes on each pants leg and the only thing Live Paint will select is the outermost stripe. I've tried Object>LivePaint>Expand then reselect the Live Paint Buckeet and click the image when it says, "Click to make Live Paint Group" but nothing changesso that I can paint the desired areas.
    I've checked the image closely to ensure there are no breaks in the paths and I've just spent the last 4 hours reading instructions and watching videos but no help. I'm braind new ti Illustrator and must be missing something bassic but don't know what. Any help would be appreciated. I'm stumped.

    I should have posted this hours ago. As soon as I did I found the answer. For anyone else with this problem, Select the image then, before using the Live Paint Bucket, select Object>Flatten Transparacy. Then, when you select the live paint bucket, it will ask for you to set the paths and after you do, it'll work just fine.

  • Help with Live Paint /CS2

    Hi everybody
    How do i fill a LivePaintGroup? I got the group, but the Bucket shows this black x, and nothing happens, no matter where i click. Also, i can't choose a swatch or your the color-toolbox to color (fill) it. Nothing happens.
    This might sound like a simple thing, and i sure didn't expect it to give me that much trouble, but i'm getting really p*ssed here, and before i start poking peoples eyes out with my wacom-pen, i thought i'd try this forum... ;-)
    Help! Pleeease!
    Cheers
    H.

    They can change the gap size Edit>Live Paint>Gap Options. That does not seem to be the problem.
    The only thing I can think of is that the layer is locked. But that would have a pencil symbol withe black line through it.

  • Need some help with a split package

    Basically, I'd like to have some code in my PKGBUILD that will append some extra info to the package name based on a file the user defined.  This is for kernel26-ck and the file I speak of is the .config he/she makes.  Below is the code that doesn't work and I think it doesn't work because the name of the package is the name of the package_name() {} function and both of of these have to match the pkgname array.  What I want is to have the pkgname array get generated dynamically based on the code below which starts before the make command in the build section.  Advise is appreciated.  Is what I'm asking for possible?
    # Contributor: graysky <graysky AT archlinux dot us>
    # Contributor: Cray "MP2E" Elliott <MP2E { AT } archlinux.us>
    # Contributor: Tobias Powalowski <[email protected]>
    # Contributor: Thomas Baechler <[email protected]>
    # Patch and Build Options
    _BFQ_patches="n" # add BFQ patches
    _makemenucfg="n" # menuconfig option
    _streamline_="n" # run Steven Rostedt's streamline_config.pl script - see notes below!
    _use_current="n" # use the current kernel's .config file - see notes below!
    # More Details and References
    ## Note all kernels get the ck patch set - there is no option to enable/disable it!
    ## BFQ
    # read, http://algo.ing.unimo.it/people/paolo/disk_sched/
    ## MAKEMENUCONFIG OPTION
    # Allow you to select additional kernel options prior to a build via a menuconfig.
    ## STREAMLINE_CONFIG OPTION
    # Similar to a make localmodconfig but this actually works!
    # WARNING - make CERTAIN that all modules are modprobed BEFORE you begin making the pkg!
    # read, https://bbs.archlinux.org/viewtopic.php?pid=830221#p830221
    # to keep track of which modules are needed for your specific system/hardware, give my module_db script.
    # a try: http://aur.archlinux.org/packages.php?ID=41689
    # Not that if you use my script, this PKGBUILD will auto run the reload_data base for you to probe
    # all the modules you have logged!
    ## USE CURRENT KERNEL'S .CONFIG
    # Enabling this option will use the .config of the RUNNING kernel rather than the ARCH defaults.
    # Useful when the package gets updated and you already went through the trouble of customizing your
    # config options. NOT recommended when a new kernel is released, but again, convenient for package bumps.
    pkgname='kernel26-ck'
    #true && pkgname=("kernel26-ck" "kernel26-ck-headers")
    _basekernel=2.6.36
    pkgver=${_basekernel}.1
    pkgrel=4
    arch=('i686' 'x86_64')
    license=('GPL2')
    url="http://users.on.net/~ckolivas/kernel"
    _archpatchversion=3
    _ckpatchversion=2
    _kernelname=-ck
    _patchname="patch-${pkgver}-${_archpatchversion}-ARCH"
    _ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
    _bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.36"
    source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2 # kernel source
    ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2 # arch patchset
    config config.x86_64 kernel26.preset # configs
    # ck patchset
    http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2
    # BFQ patches
    ${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-2.6.36.patch
    ${_bfqpath}/0002-bfq_iosched-block-add-cgroups-kconfig-and-build-bits-for-BFQ-v1-2.6.36.patch
    ${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-2.6.36.patch)
    build() {
    # Patch source with -ARCH patches
    # See http://projects.archlinux.org/linux-2.6-ARCH.git/
    msg "Patching source with-ARCH patches"
    cd ${srcdir}/linux-$_basekernel
    patch -Np1 -i ${srcdir}/${_patchname}
    # Patch source for BFQ patches
    if [ ${_BFQ_patches} = "y" ]; then
    msg "Patching source with BFQ patches"
    for p in $(ls ${srcdir}/*-bfq_*); do
    patch -Np1 -i $p
    done
    fi
    # Patch source with ck
    # Fix double name in EXTRAVERSION
    sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" ${srcdir}/${_ckpatchname}
    # Add -ck base patch set
    msg "Patching source with ck1 patch set"
    patch -Np1 -i ${srcdir}/${_ckpatchname}
    msg "Running make mrproper to clean source tree"
    make mrproper
    if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    else
    cat ../config >./.config
    fi
    # use current kernel's config
    # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191
    if [ ${_use_current} = "y" ]; then
    if [[ -s /proc/config.gz ]]; then
    msg "Extracting config from /proc/config.gz..."
    modprobe configs
    zcat /proc/config.gz > ./.config
    else
    warning "You kernel was not compiled with IKCONFIG_PROC!"
    warning "You cannot read the current config!"
    warning "Aborting!"
    exit 0
    fi
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    fi
    msg "Running make prepare for you to enable patched options of your choosing"
    make prepare
    # If user patched to BFQ and enabled it in the prev step, set it as default io scheduler
    if [ ${_BFQ_patches} = "y" ]; then
    sed -i s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set/g' ./.config
    sed -i s'/# CONFIG_DEFAULT_BFQ is not set/CONFIG_DEFAULT_BFQ=y/g' ./.config
    sed -i s'/CONFIG_DEFAULT_IOSCHED="cfq"/CONFIG_DEFAULT_IOSCHED="bfq"/g' ./.config
    fi
    if [ $_streamline_ = "y" ]; then
    msg "If you have modprobe_db installed, running reload_database now"
    if [ -e /usr/bin/reload_database ]; then
    /usr/bin/reload_database
    fi
    msg "Running Steven Rostedt's streamline_config script now "
    chmod +x ./scripts/kconfig/streamline_config.pl
    ./scripts/kconfig/streamline_config.pl > config_strip
    cp config_strip .config
    msg "An error about ksource in line 118 blah blah is NORMAL as are the one you will get for each"
    msg "module you have probed that is not in the kernel itself like nvidia for example!"
    fi
    if [ $_makemenucfg = "y" ]; then
    msg "Running make menuconfig"
    make menuconfig
    fi
    # This allows building cpu-optimized packages with according package names.
    # Useful for repo maintainers.
    CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y|M686=y" ./.config`
    CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
    case $CPU in
    CORE2)
    _pn="-core2"
    _pd=" Intel Core2 optimized."
    K8)
    _pn="-k8"
    _pd="AMD K8 optimized."
    PSC)
    _pn="-psc"
    _pd="Intel Pentium4/D/Xeon optimized."
    ATOM)
    _pn="-atom"
    _pd="Intel Atom optimized."
    K7)
    _pn="-k7"
    _pd="AMD K7 optimized."
    PENTIUMII)
    _pn="-p2"
    _pd="Intel Pentium2 optimized."
    PENTIUMIII)
    _pn="-p3"
    _pd="Intel Pentium3 optimized."
    PENTIUMM)
    _pn="-pm"
    _pd="Intel Pentium-M optimized."
    PENTIUM4)
    _pn="-p4"
    _pd="Intel Pentium4 optimized."
    default)
    esac
    # save to a file for reacall in subsequent sections
    echo "_pn=\"${_pn}\"" > vars
    echo "_pd=\"${_pd}\"" >> vars
    msg "Running make bzImage and modules"
    make bzImage modules
    package_kernel26-ck() {
    . ${srcdir}/linux-$_basekernel/vars
    pkgname="kernel26-ck${_pn}"
    pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional.${_pd}"
    backup=(etc/mkinitcpio.d/kernel26.preset)
    depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
    install=kernel26.install
    optdepends=('crda: to set the correct wireless channels of your country' \
    'nvidia-ck-stable: NVIDIA drivers for kernel26-ck' \
    'nvidia-beta-ck: NVIDIA beta drivers for kernel26-ck' \
    'modprobed_db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig')
    KARCH=x86
    cd ${srcdir}/linux-$_basekernel
    #get kernel version
    _kernver="$(make kernelrelease)"
    mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
    msg "Running make modules_install"
    make INSTALL_MOD_PATH=${pkgdir} modules_install
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # add vmlinux
    install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    # set correct depmod command for install
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
    -i $startdir/kernel26.install
    sed \
    -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
    -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
    -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
    # remove build and source links
    rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    package_kernel26-ck-headers () {
    . ${srcdir}/linux-$_basekernel/vars
    pkgname="kernel26-ck${_pn}-headers"
    pkgdesc="Header files and scripts to build modules for kernel26-ck.${_pd}"
    provides=("kernel26-ck${_pn}-headers=${pkgver}")
    mkdir -p ${pkgdir}/lib/modules/${_kernver}
    cd ${pkgdir}/lib/modules/${_kernver}
    ln -sf ../../../usr/src/linux-${_kernver} build
    cd ${srcdir}/linux-$_basekernel
    install -D -m644 Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
    install -D -m644 kernel/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
    install -D -m644 .config \
    ${pkgdir}/usr/src/linux-${_kernver}/.config
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
    for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
    done
    # copy arch includes for external modules
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
    cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
    cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
    # fix permissions on scripts dir
    chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
    cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    fi
    cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
    # add headers for lirc package
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
    cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
    # need to remove zc0301 from the array with 2.26.36
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    done
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
    # add dm headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    # add inotify.h
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
    cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
    # add wireless headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
    cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/11194
    if [ -d ${srcdir}/linux-$_basekernel/include/config/dvb ]; then
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    fi
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    # add dvb headers
    # in reference to:
    # http://bugs.archlinux.org/task/20402
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
    cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
    cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
    cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
    # add xfs and shmem for aufs building
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
    cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
    # add headers for virtualbox
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
    # add headers for broadcom wl
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
    done
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    # remove unneeded architectures
    rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    # Global pkgdesc and depends are here so that they will be picked up by AUR
    pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional."
    depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
    sha256sums=('15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04'
    '96ed15bd64ae90163f81996ee31c3db6c7433d8af156e546ca7b36bedec1728b'
    '1b9abff4752d4a294716b05ae17b981e2e5aaae1b51d19613e6b4bac0aea989d'
    'd1b8757e99ee6cbeacf0b4185236c654440d5d945458b94948fd2cc4af0a881d'
    '7ead13bbe2fdfc5308ddc3a0484d66f8150f78bbdbc59643e0b52bb9e776b5da'
    '092e17164f453bdca8bd50e4fd71c074755740252bd8ad5c3eb6d2d51e78a104'
    'f5c42a2ec2869a756e53fabada51a25dcb9de13861f367463e9ec4da8bf0b86a'
    'f3f52953a2ccc07af3f23c7252e08e61580ec4b165934c089351ddd719c3e41f'
    'cca4eea16278e302c2f7649a145e4d5ceb5ff2ece25fea3988eca82290b0c633')
    Last edited by graysky (2010-11-24 20:09:31)

    Got it!
    Allan wrote:What about in the -headers package?
    Yep, headers package is good too!
    # Generated by makepkg 3.4.1
    # using fakeroot version 1.14.4
    # Wed Nov 24 23:06:36 UTC 2010
    pkgname = kernel26-ck-headers-core2
    pkgbase = kernel26-ck
    pkgver = 2.6.36.1-4
    pkgdesc = Header files and scripts to build modules for kernel26-ck. Intel Core2 optimized.
    url = http://users.on.net/~ckolivas/kernel
    builddate = 1290639996
    packager = Unknown Packager
    size = 31174656
    arch = x86_64
    license = GPL2
    depend = coreutils
    depend = linux-firmware
    depend = module-init-tools
    depend = mkinitcpio>=0.5.20
    provides = kernel26-ck-headers-core2=2.6.36.1
    makepkgopt = strip
    makepkgopt = docs
    makepkgopt = libtool
    makepkgopt = emptydirs
    makepkgopt = zipman
    makepkgopt = purge
    PKGBUILD built using the modified makepkg suggested by nous.
    # Contributor: graysky <graysky AT archlinux dot us>
    # Contributor: Cray "MP2E" Elliott <MP2E { AT } archlinux.us>
    # Contributor: Tobias Powalowski <[email protected]>
    # Contributor: Thomas Baechler <[email protected]>
    # Patch and Build Options
    _BFQ_patches="n" # add BFQ patches
    _makemenucfg="n" # menuconfig option
    _streamline_="n" # run Steven Rostedt's streamline_config.pl script - see notes below!
    _use_current="n" # use the current kernel's .config file - see notes below!
    # More Details and References
    ## Note all kernels get the ck patch set - there is no option to enable/disable it!
    ## BFQ
    # read, http://algo.ing.unimo.it/people/paolo/disk_sched/
    ## MAKEMENUCONFIG OPTION
    # Allow you to select additional kernel options prior to a build via a menuconfig.
    ## STREAMLINE_CONFIG OPTION
    # Similar to a make localmodconfig but this actually works!
    # WARNING - make CERTAIN that all modules are modprobed BEFORE you begin making the pkg!
    # read, https://bbs.archlinux.org/viewtopic.php?pid=830221#p830221
    # to keep track of which modules are needed for your specific system/hardware, give my module_db script.
    # a try: http://aur.archlinux.org/packages.php?ID=41689
    # Not that if you use my script, this PKGBUILD will auto run the reload_data base for you to probe
    # all the modules you have logged!
    ## USE CURRENT KERNEL'S .CONFIG
    # Enabling this option will use the .config of the RUNNING kernel rather than the ARCH defaults.
    # Useful when the package gets updated and you already went through the trouble of customizing your
    # config options. NOT recommended when a new kernel is released, but again, convenient for package bumps.
    pkgname='kernel26-ck'
    true && pkgname=("kernel26-ck" "kernel26-ck-headers")
    _basekernel=2.6.36
    pkgver=${_basekernel}.1
    pkgrel=4
    arch=('i686' 'x86_64')
    license=('GPL2')
    url="http://users.on.net/~ckolivas/kernel"
    _archpatchversion=3
    _ckpatchversion=2
    _kernelname=-ck
    _patchname="patch-${pkgver}-${_archpatchversion}-ARCH"
    _ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
    _bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.36"
    source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2 # kernel source
    ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2 # arch patchset
    config config.x86_64 kernel26.preset # configs
    # ck patchset
    http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2
    # BFQ patches
    ${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-2.6.36.patch
    ${_bfqpath}/0002-bfq_iosched-block-add-cgroups-kconfig-and-build-bits-for-BFQ-v1-2.6.36.patch
    ${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-2.6.36.patch)
    build() {
    # Patch source with -ARCH patches
    # See http://projects.archlinux.org/linux-2.6-ARCH.git/
    msg "Patching source with-ARCH patches"
    cd ${srcdir}/linux-$_basekernel
    patch -Np1 -i ${srcdir}/${_patchname}
    # Patch source for BFQ patches
    if [ ${_BFQ_patches} = "y" ]; then
    msg "Patching source with BFQ patches"
    for p in $(ls ${srcdir}/*-bfq_*); do
    patch -Np1 -i $p
    done
    fi
    # Patch source with ck
    # Fix double name in EXTRAVERSION
    sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" ${srcdir}/${_ckpatchname}
    # Add -ck base patch set
    msg "Patching source with ck1 patch set"
    patch -Np1 -i ${srcdir}/${_ckpatchname}
    msg "Running make mrproper to clean source tree"
    make mrproper
    if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    else
    cat ../config >./.config
    fi
    # use current kernel's config
    # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191
    if [ ${_use_current} = "y" ]; then
    if [[ -s /proc/config.gz ]]; then
    msg "Extracting config from /proc/config.gz..."
    modprobe configs
    zcat /proc/config.gz > ./.config
    else
    warning "You kernel was not compiled with IKCONFIG_PROC!"
    warning "You cannot read the current config!"
    warning "Aborting!"
    exit 0
    fi
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    fi
    msg "Running make prepare for you to enable patched options of your choosing"
    make prepare
    # If user patched to BFQ and enabled it in the prev step, set it as default io scheduler
    if [ ${_BFQ_patches} = "y" ]; then
    sed -i s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set/g' ./.config
    sed -i s'/# CONFIG_DEFAULT_BFQ is not set/CONFIG_DEFAULT_BFQ=y/g' ./.config
    sed -i s'/CONFIG_DEFAULT_IOSCHED="cfq"/CONFIG_DEFAULT_IOSCHED="bfq"/g' ./.config
    fi
    if [ $_streamline_ = "y" ]; then
    msg "If you have modprobe_db installed, running reload_database now"
    if [ -e /usr/bin/reload_database ]; then
    /usr/bin/reload_database
    fi
    msg "Running Steven Rostedt's streamline_config script now "
    chmod +x ./scripts/kconfig/streamline_config.pl
    ./scripts/kconfig/streamline_config.pl > config_strip
    cp config_strip .config
    msg "An error about ksource in line 118 blah blah is NORMAL as are the one you will get for each"
    msg "module you have probed that is not in the kernel itself like nvidia for example!"
    fi
    if [ $_makemenucfg = "y" ]; then
    msg "Running make menuconfig"
    make menuconfig
    fi
    # This allows building cpu-optimized packages with according package names.
    # Useful for repo maintainers.
    # Code by nous.
    CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y|M686=y" ./.config`
    CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
    case $CPU in
    CORE2)
    _pn="-core2"
    _pd=" Intel Core2 optimized."
    K8)
    _pn="-k8"
    _pd="AMD K8 optimized."
    PSC)
    _pn="-psc"
    _pd="Intel Pentium4/D/Xeon optimized."
    ATOM)
    _pn="-atom"
    _pd="Intel Atom optimized."
    K7)
    _pn="-k7"
    _pd="AMD K7 optimized."
    PENTIUMII)
    _pn="-p2"
    _pd="Intel Pentium2 optimized."
    PENTIUMIII)
    _pn="-p3"
    _pd="Intel Pentium3 optimized."
    PENTIUMM)
    _pn="-pm"
    _pd="Intel Pentium-M optimized."
    PENTIUM4)
    _pn="-p4"
    _pd="Intel Pentium4 optimized."
    default)
    esac
    # save to a file for reacall in subsequent sections
    echo "_pn=\"${_pn}\"" > vars
    echo "_pd=\"${_pd}\"" >> vars
    msg "Running make bzImage and modules"
    make bzImage modules
    package_kernel26-ck() {
    . ${srcdir}/linux-$_basekernel/vars
    pkgname="kernel26-ck${_pn}"
    pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional.${_pd}"
    backup=(etc/mkinitcpio.d/kernel26.preset)
    depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
    install=kernel26.install
    optdepends=('crda: to set the correct wireless channels of your country' \
    'nvidia-ck-stable: NVIDIA drivers for kernel26-ck' \
    'nvidia-beta-ck: NVIDIA beta drivers for kernel26-ck' \
    'modprobed_db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig')
    KARCH=x86
    cd ${srcdir}/linux-$_basekernel
    #get kernel version
    _kernver="$(make kernelrelease)"
    mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
    msg "Running make modules_install"
    make INSTALL_MOD_PATH=${pkgdir} modules_install
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # add vmlinux
    install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    # set correct depmod command for install
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
    -i $startdir/kernel26.install
    sed \
    -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
    -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
    -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
    # remove build and source links
    rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    package_kernel26-ck-headers () {
    . ${srcdir}/linux-$_basekernel/vars
    pkgname="kernel26-ck-headers${_pn}"
    pkgdesc="Header files and scripts to build modules for kernel26-ck.${_pd}"
    provides=("kernel26-ck-headers${_pn}=${pkgver}")
    mkdir -p ${pkgdir}/lib/modules/${_kernver}
    cd ${pkgdir}/lib/modules/${_kernver}
    ln -sf ../../../usr/src/linux-${_kernver} build
    cd ${srcdir}/linux-$_basekernel
    install -D -m644 Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
    install -D -m644 kernel/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
    install -D -m644 .config \
    ${pkgdir}/usr/src/linux-${_kernver}/.config
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
    for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
    done
    # copy arch includes for external modules
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
    cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
    cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
    # fix permissions on scripts dir
    chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
    cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    fi
    cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
    # add headers for lirc package
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
    cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
    # need to remove zc0301 from the array with 2.26.36
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    done
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
    # add dm headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    # add inotify.h
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
    cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
    # add wireless headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
    cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/11194
    if [ -d ${srcdir}/linux-$_basekernel/include/config/dvb ]; then
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    fi
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    # add dvb headers
    # in reference to:
    # http://bugs.archlinux.org/task/20402
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
    cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
    cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
    cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
    # add xfs and shmem for aufs building
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
    cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
    # add headers for virtualbox
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
    # add headers for broadcom wl
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
    done
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    # remove unneeded architectures
    rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    # Global pkgdesc and depends are here so that they will be picked up by AUR
    pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional."
    depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
    sha256sums=('15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04'
    '96ed15bd64ae90163f81996ee31c3db6c7433d8af156e546ca7b36bedec1728b'
    '1b9abff4752d4a294716b05ae17b981e2e5aaae1b51d19613e6b4bac0aea989d'
    'd1b8757e99ee6cbeacf0b4185236c654440d5d945458b94948fd2cc4af0a881d'
    '7ead13bbe2fdfc5308ddc3a0484d66f8150f78bbdbc59643e0b52bb9e776b5da'
    '092e17164f453bdca8bd50e4fd71c074755740252bd8ad5c3eb6d2d51e78a104'
    'f5c42a2ec2869a756e53fabada51a25dcb9de13861f367463e9ec4da8bf0b86a'
    'f3f52953a2ccc07af3f23c7252e08e61580ec4b165934c089351ddd719c3e41f'
    'cca4eea16278e302c2f7649a145e4d5ceb5ff2ece25fea3988eca82290b0c633')
    @Allan - can you see any other potential down sides of implementing the patch suggested by nous?  What about dependency issues?  For example, nvidia-ck depends on kernel26-ck, not kernel26-ck-core2.  Perhaps circumvent this with a provides=('kernel26-ck-headers') for headers and provides=('kernel26-ck') for the main package?
    Last edited by graysky (2010-11-24 23:08:02)

  • Need help with testing a package with Junit

    Hi guys,
    I am currently testing a bunch of files under a particular package. I have compiled all the files in this package successfully. I have written a testcase file which is in the folder above the package folder. I am using Junit to test this. I am getting errors stating that Java cannot find the package.
    To explain in detail.....My package name is coinbox which contain some classes which need to be tested. These files are in the folder "coinbox". My testcase file is in the folder which is directly above this folder. My testcase file has the statement import coinbox.* which will import all the classes in the coinbox package;
    But I am getting an error stating that the package coinbox cannot be found. I tried adding the package path to the CLASSPATH variable but still it isnt working.
    The command am using to run the Junit test cases is as follows:
    javac -cp junit.jar;junit.samples.CoinBoxTest-d CoinBoxTest.java
    Any help or suggestions regarding will be appreciated. The coinbox package is not being detected by java.
    Thanks in advance.
    Edited by: calvin_nr on Sep 30, 2007 5:12 PM

    It smells like a classpath problem. Post a sample of the code you are testing, the package statement in particular and the directory structure where the .class files are.

  • Newbie help with SAX, jclark package not found

    I'm trying do a simple SAX exercise. My work files are on my d:\workspace\xml directory and I'm running win2k pro. I have extracted saxjava-1.0.zip to e:\XML\sax, the jdk to e:\j2sdk1.4.0, and james clark xp parser to e:\XML\xp
    I have set my environment variables according to the book
    variable: CLASSPATH
    value: .;E:\XML\sax;E:\XML\xp\xp.jar
    when I compile my java file I get the error:
    package com.jclark.xml.sax does not exist
    Parser parserObj = new com.jclark.xml.sax.Driver();
    Note: BandReader.java uses or overrides a deprecated API
    Note: Recompile with -deprecated for details
    1 error
    When I go into the directory E:\XML\xp\com\jclark\xml\sax , the file "Driver.java" is there
    code in my BandReader.java file
    import org.xml.sax.*;
    public class BandReader extends HandlerBase  {
         public static void main(String[] args) throws Exception  {
              System.out.println("Here we go...");
              BandReader readerObj = new BandReader();
              readerObj.read();
         public void read () throws Exception  {
              Parser parserObj = new com.jclark.xml.sax.Driver();
              parserObj.setDocumentHandler (this);
              parserObj.parse ("file:///d:/workspace/xml/bands.xml");
         public void startDocument() throws SAXException  {
              System.out.println("Starting...");
         public void endDocument() throws SAXException  {
              System.out.println("...Finished");
         public void startElement(String name, AttributeList atts) throws SAXException  {
              System.out.println("Element is " + name);
    }

    I downloaded sun's java_xml_pack-summer-02_01 and extracted the contents to e:\xml\sun and have changed my classpath environment variable to E:\XML\sun\jaxp-1.2_01:e:\XML\xp\xp.jar
    How would I change my code for my exercise to work? I tried the following and I get 4 errors.
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    public class BandReader extends ContentHandler  {
         public static void main(String[] args) throws Exception  {
              System.out.println("Here we go...");
              //BandReader readerObj = new BandReader();
              //readerObj.read();
              //Use an instance of ourselves as the SAX event handler
                 DefaultHandler handler = new BandReader();
              //Use the default (non-validating) parser
                 SAXParserFactory factory = SAXParserFactory.newInstance();
         public void read () throws Exception  {
              //Parse the input
                 SAXParser parserObj = factory.newSAXParser();
              parserObj.setDocumentHandler (this);
              //Parser parserObj = new com.jclark.xml.sax.Driver();
              //parserObj.setDocumentHandler (this);
              parserObj.parse ("file:///d:/workspace/xml/bands.xml");
         public void startDocument() throws SAXException  {
              System.out.println("Starting...");
         public void endDocument() throws SAXException  {
              System.out.println("...Finished");
         public void startElement(String name, AttributeList atts) throws SAXException  {
              System.out.println("Element is " + name);
    }

  • Help with creating a package

    I have created a function on the table called PL_REPORTED_CRIME
    CREATE OR REPLACE FUNCTION tot_num_of_crime_sf
    (       CRIME_TYPE_ID    NUMBER)
    RETURN      NUMBER
    IS
         lv_tot_num_of_crime     NUMBER (8, 2);
    BEGIN
         SELECT     SUM (FK1_CRIME_TYPE_ID)
         INTO     lv_tot_num_of_crime
         FROM     PL_REPORTED_CRIME
         WHERE     FK1_CRIME_TYPE_ID = CRIME_TYPE_ID;
         RETURN lv_tot_num_of_crime;
    END;Now I need to create a package. I am bit confuge that. Do I Have to create a package on the same table or not. please help
    Edited by: user9125158 on May 4, 2011 1:16 PM
    Edited by: BluShadow on 04-May-2011 13:28
    fixed {noformat}{noformat} tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    user9125158 wrote:
    I have created a function on the table called PL_REPORTED_CRIME
    {CREATE OR REPLACE FUNCTION tot_num_of_crime_sf
    (       CRIME_TYPE_ID    NUMBER)
    RETURN      NUMBER
    IS
         lv_tot_num_of_crime     NUMBER (8, 2);
    BEGIN
         SELECT     SUM (FK1_CRIME_TYPE_ID)
         INTO     lv_tot_num_of_crime
         FROM     PL_REPORTED_CRIME
         WHERE     FK1_CRIME_TYPE_ID = CRIME_TYPE_ID;
         RETURN lv_tot_num_of_crime;
    END;}
    Now I need to create a package. I am bit confuge that. Do I Have to create a package on the same table or not. please help
    Edited by: user9125158 on May 4, 2011 1:16 PMHi,
    Create package spec as below and include your function declaration here.
    Create package test_pkg AS
    FUNCTION tot_num_of_crime_sf
    ( CRIME_TYPE_ID NUMBER)
    RETURN NUMBER
    END  test_pkg;Now create package body which actually contains the logic for your function.
    create or replace package body test_pkg
    AS
    FUNCTION tot_num_of_crime_sf
    ( CRIME_TYPE_ID NUMBER)
    RETURN NUMBER
    IS
    lv_tot_num_of_crime NUMBER (8, 2);
    BEGIN
    SELECT SUM (FK1_CRIME_TYPE_ID)
    INTO lv_tot_num_of_crime
    FROM PL_REPORTED_CRIME
    WHERE FK1_CRIME_TYPE_ID = CRIME_TYPE_ID;
    RETURN lv_tot_num_of_crime;
    END;
    END;Compile both spec and body.
    Hope this helps...
    Regards,
    Achyut K

  • Help with a JMF package

    I've found that the cross-platform JMF software that I have recently downloaded from the sun website doesnt contain the
    com.sun.media.protocol.vfw.VFWCapture package I was wondering if anyone could provide me with this file.
    I have extracted my "package.jar" file and traced out the folder structure.
    and Ive found that this package does not exist.

    Hi,
    try to implement the Interface MouseListener (or the corresponding MouseAdapter):
    eg:
    class DrawingToolFrame extends JFrame implements ActionListener, MouseListener{
    //add a MouseListener to the component withing you would like to fetch the mouse-coordinates
    yourPanel.addMouseListener(this);
    //implement the five methods of the MouseListener
    public void mouseClicked(MouseEvent�e){}
    public void mouseEntered(MouseEvent�e){}
    public void mouseExited(MouseEvent�e) {}
    public void mousePressed(MouseEvent�e){}
    public void mouseReleased(MouseEvent�e){
    e.getX(); //Coordinates of the mouse after releasing the button
    e.getY();

  • Help with iphone return package

    i sent my original iphone 4 back to apple, as i got a replacement one. The courier was ups.
    the address on the label said lutterworth, but on the tracking it says HARBOROUGH
    apple mailing adress is lutterworth, but on the tracking it says that it got delivered to harborough.
    any help?
    heres the tracking number
    1ZW9V0799150882955
    heres the website
    http://wwwapps.ups.com/WebTracking/track?loc=en_GB
    please help

    Packages get misdelivered, yes. You need to start by calling UPS and discussing this with them. There's really nothing anyone here can do to help; we can only commiserate.
    Good luck.

  • I need help with digital painting

    I have a sketch that I want to add color to but it always turns out flat-looking (if that makes sense). I can't seem to find any good tutorials online on digital painting. Can anyone give me good tips? This is the sketch.

    Chrishonda, I may be missing something but . . Can I say painting in digital is very much like painting in canvas. Have you approached it as putting down some light base color in front of the face, say right cheek there. Brush darker as you move away from the cheek bone toward the temple. less dark as you move toward the nose. Then go back the the cheek bone and put down some lighter tone, right where the light would be reflecting off the cheek bone high spot. In PShop, set your brush options to "Fade" in x pixels, try 25 or maybe 100, depending on size and resolution.
    You might check out a post or 'how to' on 'painting on layers with 50 gray fill'.
    and have fun .

Maybe you are looking for